<para>If you just want to make a CD filled with music, and not be bothered with all of the details, I have good news for you: Kees Cook (<email>kees@outflux.net</email>) put together a tool based on this HOWTO, which automates all of the tasks outlined here. His program can be obtained from <ulink url="http://outflux.net/unix/software/mp3cd/">http://outflux.net/unix/software/mp3cd/</ulink>. Thanks, Kees!
<para>The CD Audio specification requires wave files that are 16 bit, stereo, 44.1 kHz. MP3 files often have different parameters, but we need to convert them to WAV first, anyway.</para>
<para>We have several choices for the conversion process.</para>
<section id="mpg321"><title>mpg123 and mpg321</title>
<para>Originally, there was only <command>mpg123</command>. However, it uses a proprietary licensing, and now there's an open source replacement - <command>mpg321</command>. Both commands use the same syntax: </para>
for i in *.mp3; do mpg321 -w `basename $i .mp3`.wav $i; done </programlisting>
<para>When decoding 22khz MP3 files the output of <command>mpg123</command> may be distorted. I don't know how well <command>mpg321</command> deals with this problem. If you're converting with <command>mpg123</command>, use:</para>
player and they sounded OK. So <command>mpg123</command> is not my converter of choice.
</para>
</section>
<section id="madplay"><title>MAD</title>
<para>Another MP3 player/decoder, and the one I prefer, is <command>madplay</command>. It's available from <ulink url="http://www.mars.org/home/rob/proj/mpeg/">http://www.mars.org/home/rob/proj/mpeg/</ulink>.
Unfortunately, <command>madplay</command> also had problems with some of MP3 files I had. I don't think there's a problem with the decoder, but rather with it handling broken MP3 files.</para>
</section>
<section id="lame"><title>Lame</title>
<para>The <command>lame</command> encoder, which has a decoding mode, seems
to handle difficult cases very well (<command>lame</command> can be found at <ulink url="http://www.mp3dev.org/mp3/">http://www.mp3dev.org/mp3/</ulink>) :
</para>
<programlisting>
for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done
<para>Well, this HOWTO is about MP3 files, but OGG standard is an alternative which many people prefer over MP3 because of the licensing. To deal wit OGG files, you need to use:</para>
<programlisting>
for i in *.ogg ; do ogg123 -d wav -f `basename $i .ogg`.wav $i; done
<para>Nico Genimakis sent me an email about using <emphasis>mplayer</emphasis> to covert audio in many different formats to WAV with automatic resampling to 44100Hz. Mplayer is known to be able to read almost anything, and it can convert your .ogg, .mp3, .flac, .wma etc.</para>
<para>Normalisation is a process during which all the sound files are brought to the same relative loudness level. I use a program by Chris Vaill (<email>cvaill@cs.columbia.edu</email>), called
what SCSI device your CD-writer is. If you're using ATAPI writer, with older kernel, use SCSI
emulation (kernel module ide-scsi). As of kernel 2.6, you can use ATAPI directly, without SCSI emulation, by prepending <emphasis>ATAPI:</emphasis> to the device specification. Let's assume, that your ATAPI cdwriter
<section id="dao-burning"><title>Burning a DAO CD</title>
<para>
DAO, Disc-At-Once, is as of now the only method for burning a CD without a 2-second pause between the tracks.
It's useful for burning party mixes. The program for burning CDs in DAO mode is <command>cdrdao</command>, available from SourceForge, <ulink url="http://sourceforge.net/projects/cdrdao/">http://sourceforge.net/projects/cdrdao/</ulink>.
</para><para>
The <command>cdrdao</command> program uses description files called <emphasis>TOC</emphasis> (Table Of Contents, of course). There are two ways to create such file. First is to use a shell script, distributed with <command>cdrdao</command> source (in <filename>contrib</filename> directory, called <command>generate_toc.sh</command>. It takes a list of <filename>.wav</filename> files as an argument and produces a <filename>cd.toc</filename> file. Second way is to simply create such file yourself in a text editor of your choice. Here is a self-explanatory example:</para>
The <emphasis>0</emphasis> (zero) after the wave filename means start from the beginning of the file. There can be a second number providing the length (time) of file to record. The <command>xcdroast</command> creates similar <emphasis>TOC</emphasis> files, there are also examples in <filename>testtocs</filename> directory of <command>cdrdao</command> source.
The <command>cdrdao</command> by default uses the device <filename>/dev/cdrecorder</filename>, which should be a link to the cdwriter device. Assuming your cd recorder device file is <filename>/dev/scd0</filename>, create the link (as root) as follows:
</para>
<programlisting>
ln -s /dev/scd0 /dev/cdrecorder
</programlisting>
<para>
Then, assuming that the <emphasis>TOC</emphasis> file is named <filename>cd.toc</filename> the command to burn the cd is simply:
With increasing popularity of CD/MP3 players burning data CDs for listening purposes become practical. The advantage is definitely being able to squeeze ten times more music onto one CD (a very approximate figure).</para>
First I would recommend the filename cleanup steps outlined at the beginning of this document. Conversion to WAV is, obviously, not needed here. To normalize MP3 files without losing quality by conversions, use <command>mp3gain</command>. This program is available from <ulink url="http://www.maazl.de/project/mp3/mp3gain.html">http://www.maazl.de/project/mp3/mp3gain.html</ulink> or <ulink url="http://mp3gain.sourceforge.net/">http://mp3gain.sourceforge.net/</ulink> (but this second site seems to contain Windows-oriented version). You'd need to issue the command:</para>
As far as burning is concerned, MP3 data CD-s are just a standard data CD's (ISO9660) with MP3 files on it. All MP3-CD players I know accept CD-s with directories in them, and I usually burn CD with Joliet extension and they work just fine. So to burn such a CD under linux, you first need to create an ISO image an then burn it on the CD as in the example below:
<para>CD Burning from the command line: <ulink url="http://freeunix.dyndns.org:8088/site2/howto/Burn_em_Baby.shtml">http://freeunix.dyndns.org:8088/site2/howto/Burn_em_Baby.shtml</ulink></para>
Im Eunjea - Translated this document to Korean, URL is <ulink url="http://kltp.kldp.org/eunjea/mp3_burning/">http://kltp.kldp.org/eunjea/mp3_burning/</ulink>.
Mendel L Chan - Translated this document to Chinese, URL is <ulink url="http://www.linux.org.tw/CLDP/mini/MP3-CD-Burning/">http://www.linux.org.tw/CLDP/mini/MP3-CD-Burning/</ulink>.
Chie Nakatani - Translated this document to Japanese, URL is <ulink url="http://www.linux.or.jp/JF/JFdocs/MP3-CD-Burning/index.html">http://www.linux.or.jp/JF/JFdocs/MP3-CD-Burning/index.html</ulink>.
Laszlo Daczi - Translated this document to Hungarian, URL is <ulink url="http://tldp.fsf.hu/HOWTO/MP3-CD-Burning-hu/index.html">http://tldp.fsf.hu/HOWTO/MP3-CD-Burning-hu/index.html</ulink>.
</para>
</listitem>
<listitem>
<para>
Alix - Translated this document to French, available at French TLDP site <ulink url=" http://www.traduc.org"> http://www.traduc.org</ulink>.
<para>I have had a great response to the previous releases of this HOWTO. So many people contributed, that I decided to change this section slightly in order to list all of the names.
<para>Greg Ferguson, Rob Russell, Terry Davis, Chris Vaill, Jamie Kellogg, Tom Panning, Adam Buckley, Ilia Lobsanov, Giuseppe "Cowo" Corbelli, Florent Fievez, Piero Ottuzzi, Kees Cook, Andrew Newman, David DeVault, Nico Genimakis, Jan-Erik Stromquist.