Burning CD's with Linux

Ripping - .wav to .mp3 - Downloading - .mp3 to .wav - Normalize - Burning Audio - Burning Data
Ripping to Burning -   There are several command line and GUI utilities to use for each step in burning a CD but if you want all-in-one solution k3b is comprehensive and easy to use.
Recording (or ripping) Tracks from Audio CDs -  There are several tools for recording audio CDs to hard disk. You can record a single track, selected tracks or the entire CD at once. The music will be converted to a file format that can be read by your computer (usually .wav) as it is recorded.There are both command line and graphical tools for the job. My favourite is graphical (when I can get it installed right) while my dad's favorite is the command line.

  GUI
grip is the program I am most familiar with.

Grip comes standard with the latest versions of both Redhat and Mandrake.
Before ripping, you need to select the tracks that you would like to rip. This can be done by right-clicking on tracks in the "Tracks" tab, or left clicking on a track when your mouse is under the "Rip" column. In addtion, you can quickly select/deselect all tracks for ripping by clicking on the "Rip" column label. To both rip and encode from WAV to MP3 click on the "rip + enccode" button.

  Command Line

Here are some examples of how to record tracks from an audio CD using cdparanoia:

To record a single track: type cdparanoia n

"n"  specifies the track number to record. By default the track will be recorded to a file named cdda.wav. If cdda.wav already exists it will be overwritten, so be careful if you are recording several tracks! You can specify your own file name like this:

cdparanoia n filename.wav

 
To record the entire CD type: cdparanoia -B

The -B in the above command simply ensures that the tracks are put into separate files (track1.wav, track2.wav etc.). Cdparanoia has many more options and an easy to understand manual page; type man cdparanoia to read it.

Converting .wav files to mp3 - If you intend to burn files to an audio CD, you should leave them in .wav format. On the other hand, if you want to play them from your hard drive, or burn a data CD that you'll play from your computer, you'll probably want to convert them to the mp3 format to save space. One of the most popular tools for this is bladeenc. To convert a .wav file into a .mp3 use this command:

bladeenc filename.wav


This will produce a file with the same name as the source file, but with the .mp3 suffix. If you want to specify a destination filename you can add it to the end like this:

bladeenc filename.wav filename.mp3


By default, bladeenc will encode the file at 128kbit/sec, this is the most commonly used bitrate and results in a very compact file of reasonable quality. Higher rates can be specified, giving a better sound quality at the expense of a slightly bigger filesize, though it's hard to detect any improvement in sound quality using sampling rates above 160kbits/sec. To convert a file at 160kbits/sec use:
bladeenc -160 filename.wav

Downloading - There are several peer to peer cliants available for Linux. The one I use is LimeWire. LimeWire has a clean graphical interface and is easy to install. The beta version is for free and the profesinal version is aboout $10.00.

Converting .mp3 files into .wav format - Audio CDs are usually burned from a collection of .wav or .cdr files - you can't directly burn mp3s to an audio cd unless you convert them to one of these formats. The mpg123 program can do this for you and is often installed by default with many distros. To convert an .mp3 to a .wav,  type:

mpg123 -w filename.wav filename.mp3
(note - the destination filename comes first)

Note also that there is some slight loss of sound quality when a .wav file is converted to mp3 format, and this isn't regained when converting back to .wav - so if possible, you should try to use .wav files that have been ripped from an audio CD rather than converting back from mp3s.

To "Normalize" a group of .wav files - Creating an audio CD using tracks from different sources can lead to variations in volume amongst the tracks. By using a program named normalize, you can equalize the volume level of a group of files. You'd normally do this to a group of .wav files before burning them to CD. Normalize is a command line tool; to equalize the volume of all the .wav files in a folder type:

normalize -m /path/to/files/*.wav


Recording (or burning) an Audio CD - I'll assume that you have a CDR or CDRW drive installed and configured already - if you don't, see the links section at the end of this article for more information on set-up details. I'll also assume that you'll be using cdrecord to burn your disks - it's the most popular tool for this and is also what's used by most graphical front-ends like XCDRoast etc. Your files will need to be in .wav or .cdr format; most likely they will be .wavs. Put all the files you want to burn into a separate folder to simplify the burning process, and make sure that they will fit onto the disk (you can check by changing into the folder and running the du command). Now it's just a matter of typing this command:

cdrecord -v speed=4  dev=0,0,0 -audio -pad *.wav


Of course, your speed and device numbers might be different - you can use cdrecord -scanbus to find the device address, and the speed setting will depend on your CD burners' speed rating. In general, burning will be more reliable at slower speeds,  especially on older machines.

Recording a Data CD (mp3 or ogg) - If you only plan to play a music CD on your computer or other mp3 capable device, you can burn mp3 or ogg files in exactly the same way as an ordinary data CD. Because data CDs use a filesystem, we'll use mkisofs (to create the filesystem) and cdrecordto burn the disk. As in the audio CD example above, put all the files into a separate folder. The two operations can be combined into a single command like this:

mkisofs -R /path/to/folder_to_record/ | cdrecord -v speed=4 dev=0,0,0 -


Don't forget the hyphen at the end! As in the example for burning audio CDs, you might have to use different speed and dev numbers.
 Older or slower computers might have difficulties running both mkisofs and cdrecord at once - if so you can do it as two separate operations like this:

mkisofs -R -o cdimage.raw /path/to/folder_to_record/


This creates an image named cdimage.raw. Then burn the disk:

cdrecord -v speed=4 dev=0,0,0 cdimage.raw
(using suitable speed and dev settings..)