Next Previous Contents

23. Creating Audio CD's

23.1 Intro.

There may be times when you may need to convert your Ogg or MP3 files to CDDA format and create a normal audio CD.

It's beyond the scope of this HOWTO to cover setting-up of CDR drives, but if you need more information on this subject a good read of the CD-Writing HOWTO, by Winfried Trümper, which can be found here:

http://www.ibiblio.org/pub/Linux/docs/HOWTO/CD-Writing-HOWTO

A more thorough overview of this subject can be found in the Linux MP3 CD Burning mini-HOWTO By Greg Wierzchowski which can be found here:

http://www.ibiblio.org/pub/Linux/docs/HOWTO/mini/MP3-CD-Burning">

There are now several tools for burning CD's which are detailed in the HOWTO's listed above.

23.2 Converting to wav

Earlier in the HOWTO I mentioned that converting audio CD's to MP3 was normally a two stage process. Naturally enough it's normally a two stage process to convert MP3's or Ogg files to CDDA audio.

Firstly you'll need to convert your file to wav format.

Using ogg123 you can convert an .ogg file to wav like so:


[me@megajukebox assorted]$ ogg123 -d wav -o file:mysong.wav mysong.ogg
Playing from file mysong.ogg.

Bitstream is 2 channel, 44100Hz
Encoded by: Xiphophorus libVorbis I 20010225

Done.

With a mix of mpg123 and sox here's how you convert a .mp3 to wav:


[me@megajukebox assorted]$ mpg123 -s mysong.mp3 | sox -t raw -r 44100 -s -w -c 2 - mysong.wav

23.3 Burning to CD

Ok, so that's the first part, now to put the wav onto the blank CD.

Using cdrecord we convert the wav to CDDA and burn it onto the disk.


[me@megajukebox assorted]$ cdrecord -pad -v dev=1,0 -dao speed=12 *.wav

All being well, you should now have an audio CD!

Here's a quick run through of the flag's I've used, taken from cdrecord's man page:

-pad

Because many structured audio files do not have an integral number of blocks (1/75th second) in length, it is often necessary to specify the -pad option as well.

-v = Verbose

dev=1,0 = The device refers to scsibus/target/lun of the CD- Recorder.

-dao

Set Disk At Once mode. This currently only works with MMC drives that support non raw Session At Once mode.

speed=#

Set the speed factor of the writing process to #. # is an integer, representing a multiple of the audio speed. This is about 150 KB/s for CD-ROM and about 172 KB/s for CD-Audio. If no speed option is present, cdrecord will try to get the speed value from the CDR_SPEED environment. If your drive has problems with speed=2 or speed=4, you should try speed=0.

I've enabled SCSI emulation for my CD burner, details can be found in the HOWTO's.


Next Previous Contents