| 1 | An approach for reading and encoding taken in abcde is the use of Unix pipes. |
| 2 | |
| 3 | By this way, a program sends as output what another programs expects as input, |
| 4 | without writing the information in the hard disk. |
| 5 | |
| 6 | For it to work with abcde, a ripper must send the data of the CD tracks which |
| 7 | are ripped to the standard output, while sending the information and error |
| 8 | messages to another "stream", so that the encoder does not get confused. This |
| 9 | second stream is called "standard error". |
| 10 | |
| 11 | The encoder program needs to be able to encode the information send to it by |
| 12 | reading from the standard input (which is what the ripper sends to the standard |
| 13 | output). |
| 14 | |
| 15 | Usually Unix/Linux programs deal with the standard input/output by using the |
| 16 | special file name "-", as in the following example: |
| 17 | |
| 18 | cdripper -o - | audioencoder -i - -o file.ext |
| 19 | |
| 20 | The "cdripper" program uses the flag "-o" to identify the file it will output |
| 21 | the data to. For the "audioencoder" program to be able to read the output |
| 22 | through a Unix pipe (the "|" symbol), the output needs to be sent to the |
| 23 | standard output using the "-" special filename. |
| 24 | |
| 25 | Once the output has been pipped to "audioencoder" we use the same special |
| 26 | filename to read the information as input with the "-i" flag and output it to |
| 27 | "file.ext" with the "-o" flag. |
| 28 | |
| 29 | Keep in mind that the example above is only that, an example, and every ripper |
| 30 | and encoder differs from in each other in the way they interact with pipes. |
| 31 | |
| 32 | For one reason, not all the rippers and encoders are supported by abcde: the |
| 33 | author (or the users) have not included support for them. |
| 34 | |
| 35 | If you plan to use a ripper or encoder which is not supported, you need to know |
| 36 | how to use the ripper/encoder. For example, cdparanoia just uses "-" as the |
| 37 | output filename and works. The program used to decode FLAC files (yes, abcde |
| 38 | supports "ripping" from a FLAC file :) uses "-c ". |
| 39 | |
| 40 | To add support for a ripper called "cdripper" which uses the "-" special flag |
| 41 | for outputting to the standard output, you need to open the config file (either |
| 42 | /etc/abcde.conf or ~/.abcde.conf) and add the line: |
| 43 | |
| 44 | PIPERIPPER_cdripper="-" |
| 45 | |
| 46 | For an encoder called "audioencoder" which uses "--stdin" to read the pipe |
| 47 | input, you need to add: |
| 48 | |
| 49 | PIPE_audioencoder="--stdin" |
| 50 | |
| 51 | Of course, you should try your configuration and report it so that it can be |
| 52 | included in future versions of abcde. |
| 53 | |
| 54 | If you are familiar with POSIX shell programing, please open "abcde" and take a |
| 55 | look at the lines below the one marked with "###USEPIPESSUPPORT###". |
| 56 | |
| 57 | Thanks for your time! |