Creating Audio Files from CDs

Creating Audio Files from CDs

Most audio CDs have a relatively simple format. The beginning of the disc contains a table of contents, which describes the starting point and length of each track on the CD. The unit of measurement is the sector, which equals 1/75 of a second. Therefore, a song exactly 4 minutes long would have a length of 4 x 60 x 75 = 18,000 sectors. Each sector consists of 588 16-bit samples on both left and right channels. This adds up to 44,100 samples per second, with four bytes per sample. See now why this sample rate is considered to produce CD-quality sound?

A track does not need to start directly after the end of the previous track. There are usually gaps of up to a few seconds between tracks. These gaps can be blank, or they can contain nonaudio data. In fact, some recent audio CDs include multimedia presentations in the leftover space at the end of the disc. Ultimately, audio CDs look much like a number of raw PCM files stored on a physical medium (there are some technical differences, but I won't go into them).

cdparanoia is one of the best tools to record, or rip, CD tracks. It works for either IDE or SCSI CD-ROMs, and includes automatic jitter and error correction. It is capable of rereading areas of the disc that may be scratched or dusty , to try to obtain the best-quality recording possible.

cdparanoia has a number of options, all available from the man page. To list a CD's table of contents, use the -Q option.

 $ cdparanoia -Q 
 cdparanoia III release 9.6 (August 17, 1999) 
 (C) 1999 Monty <monty@xiph.org> and Xiphophorus 
 Report bugs to paranoia@xiph.org http://www.xiph.org/paranoia/ 
 
 Table of contents (audio tracks only): track length begin copy pre ch 
 =========================================================== 
 1. 14348 [03:11.23] 32 [00:00.32] no no 2 
 2. 13752 [03:03.27] 14380 [03:11.55] no no 2 
  3. 13783 [03:03.58] 28132 [06:15.07] no no 2  
  4. 12845 [02:51.20] 41915 [09:18.65] no no 2  
  5. 14032 [03:07.07] 54760 [12:10.10] no no 2  
  6. 11155 [02:28.55] 68792 [15:17.17] no no 2  
  7. 10128 [02:15.03] 79947 [17:45.72] no no 2  
  8. 11570 [02:34.20] 90075 [20:01.00] no no 2  
  9. 18842 [04:11.17] 101645 [22:35.20] no no 2  
  10. 10600 [02:21.25] 120487 [26:46.37] no no 2  
  11. 23330 [05:11.05] 131087 [29:07.62] no no 2  
  12. 18413 [04:05.38] 154417 [34:18.67] no no 2  
  13. 14072 [03:07.47] 172830 [38:24.30] no no 2  
  14. 24080 [05:21.05] 186902 [41:32.02] no no 2  
  15. 17873 [03:58.23] 210982 [46:53.07] no no 2  
  16. 13225 [02:56.25] 228855 [50:51.30] no no 2  

This tells the utility to search for a CD-ROM drive and, if one is found, to query its contents. To rip audio tracks, use the following syntax:

  $ cdparanoia 2 track-2.wav  
  $ cdparanoia 1-16 onebigfile.wav  
  $ cdparanoia -B  

By default, the output format is a WAV file. You can also rip portions of tracks, basically from any sector to any other sector, regardless of their relationship. Use the ”help option for details on the start and end syntax. Another useful option is -B, which will rip all the tracks on a CD and place each into its own WAV file, named track01cdda.wav, track02cdda.wav, and so on.

Since cdparanoia saves all songs as uncompressed WAV files, you can imagine how your disk space will be rapidly depleted. A single CD's worth of songs averages about 650MB when stored as WAVs, so you want to have a large scratch space and to convert the files into MP3 or Ogg format before ripping the next CD. I use the leftover 2GB partition on my Windows drive as a storage area for massive audio and video files. Under all circumstances, you don't want to use your root partition or the /var and /tmp directories unless you know you have enough space.

If all you want to do is rip songs from a CD and convert them into MP3s, there are a number of utilities to do everything in one step. In fact, it seems you can't turn around these days without seeing another ripper/encoder application. My personal favorite is the GTK-based grip. But cdparanoia and similar applications are much better if you actually want to go outside that narrow scope, for example, if you want to sample a few seconds from a song for your newest techno tune.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net