FreeUnix.Dyndns.Org Sat, 21 November 2009 - 10:36:42 CET
Home ·  AcpiTool ·  Howto ? ·  Links ·  Hardware ·  FTP Archive ·  Search ·  Contact ·  About
>  MP3 encoding on Linux  <
Ripping tracks from audio CD's
To encode MP3 files, you need the source audio file, usually a .WAV file. You can create .WAV's by ripping tracks from regular audio CD's.

To rip tracks from CD's, you can use cdparanoia or cdda2wav. cdparanoia only works on SCSI drives. This means you have to enable SCSI emulation on your linux machine if you only have IDE cdrom drives (like most people do).
When this is ok, you have to find out if cdparanoia can find the scsi interface for your cdrom drive. Just type :

 # cdparanoia -vsQ
 cdparanoia III release 9.8 (March 23, 2001)
 (C) 2001 Monty <monty@xiph.org> and Xiphophorus

 Report bugs to paranoia@xiph.org
 http://www.xiph.org/paranoia/

 Checking /dev/cdrom for cdrom...
         Testing /dev/cdrom for cooked ioctl() interface
                 /dev/sr0 is not a cooked ioctl CDROM.
         Testing /dev/cdrom for SCSI interface
                 generic device: /dev/sg0
                 ioctl device: /dev/sr0

 Found an accessible SCSI CDROM drive.
 Looking at revision of the SG interface in use...
         SG interface version 3.1.24; OK.

 CDROM model sensed sensed: HITACHI DVD-ROM GD-S250 0010 

 Checking for SCSI emulation...
         Drive is ATAPI (using SCSI host adaptor emulation)

This looks good. Now we can start ripping tracks. An example :

# cdparanoia -w "2" "Track_nr2.wav"

This will rip the 2nd track and store it in "Track_nr2.wav". Make sure you have enough free disk space available to store the wav files. If you want to know more about cdparanoia, just type "man cdparanoia".

The 2nd audio ripper is cdda2wav. This software can rip audio tracks from CD using regular ATAPI cdrom drives. You no longer need SCSI emulation and as a bonus, audio extraction is a lot faster on a 2.6 kernel because it also supports DMA on ATAPI drives. Get it here.
To use it, just type :

# cdda2wav dev=/dev/cdrom -t 5 track05.wav

Converting ripped tracks into MP3's
To convert wav's to mp3's , you can use bladeenc or lame. An example :

# bladeenc -192 "Track_nr2.wav"

This wil convert Track_nr2.wav into a 192 Kbps MP3 called Track_nr2.mp3. This can take a few minutes, depending on the processor power (a P200MMX needs 5 minutes to convert a 50 MB wav). Bladeenc works fine but can only produce CBR (Constant Bitrate) MP3 files.

Lame can also create ABR (Average Bitrate) or VBR (Variable Bitrate) MP3 files. This allows you to maintain high quality encoding while using less diskspace. An example :

# lame -V 2 -b 192 "Track_nr2.wav" "Track_nr2.mp3"

This wil convert Track_nr2.wav into an MP3 called Track_nr2.mp3 of variable bitrate with a minimal bitrate of 192 Kbps. The "-V n" option specifies the quality level (default = 4).

Top