Editorial review of MP3 chapter.

Sponsored by:	iXsystems
This commit is contained in:
Dru Lavigne 2014-04-21 17:17:07 +00:00
parent afcecce528
commit 3e5c6eb2ce
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44616

View file

@ -66,7 +66,7 @@
</listitem>
<listitem>
<para>Rip CD and <acronym>DVD</acronym> content into
<para>Rip <acronym>CD</acronym> and <acronym>DVD</acronym> content into
files.</para>
</listitem>
@ -251,13 +251,13 @@ pcm2: &lt;Conexant CX20590 (Analog 2.0+HP/2.0)&gt; (play/rec) default</screen>
<para>If all goes well, the sound card should now work in os;.
If the <acronym>CD</acronym> or <acronym>DVD</acronym> drive
is properly connected to the sound card, one can insert an
audio CD in the drive and play it with
audio <acronym>CD</acronym> in the drive and play it with
&man.cdcontrol.1;:</para>
<screen>&prompt.user; <userinput>cdcontrol -f /dev/acd0 play 1</userinput></screen>
<warning>
<para>Audio CDs have specialized encodings which means that
<para>Audio <acronym>CD</acronym>s have specialized encodings which means that
they should not be mounted using &man.mount.8;.</para>
</warning>
@ -486,7 +486,7 @@ pcm7: &lt;HDA Realtek ALC889 PCM #3 Digital&gt; at cad 2 nid 1 on hdac1
</info>
<para>This section describes some <acronym>MP3</acronym>
players available for &os;, how to rip audio CD tracks, and
players available for &os;, how to rip audio <acronym>CD</acronym> tracks, and
how to encode and decode <acronym>MP3</acronym>s.</para>
<sect2 xml:id="mp3-players">
@ -494,146 +494,132 @@ pcm7: &lt;HDA Realtek ALC889 PCM #3 Digital&gt; at cad 2 nid 1 on hdac1
<para>A popular graphical <acronym>MP3</acronym> player is
<application>XMMS</application>.
<application>Winamp</application>
skins can be used with <application>XMMS</application> since
the interface is almost identical to that of Nullsoft's
<application>Winamp</application>.
<application>XMMS</application> also has native plug-in
support.</para>
<para><application>XMMS</application> can be installed from
It supports <application>Winamp</application>
skins and additional plugins. The interface is intuitive,
with a playlist, graphic equalizer, and more. Those familiar
with <application>Winamp</application> will find
<application>XMMS</application> simple to use. On &os;,
<application>XMMS</application> can be installed from
the <package>multimedia/xmms</package> port
or package.</para>
<para><application>XMMS</application>'s interface is intuitive,
with a playlist, graphic equalizer, and more. Those familiar
with <application>Winamp</application> will find
<application>XMMS</application> simple to use.</para>
<para>The <package>audio/mpg123</package> port
<para>The <package>audio/mpg123</package> package or port
provides an alternative, command-line <acronym>MP3</acronym>
player.</para>
<para><application>mpg123</application> can be run by specifying
the sound device and the <acronym>MP3</acronym> file on the
command line. Assuming the audio device is
<filename>/dev/dsp1.0</filename> and the
<acronym>MP3</acronym> file is
<replaceable>Foobar-GreatestHits.mp3</replaceable>, enter the
following to play the file:</para>
<screen>&prompt.root; <userinput>mpg123 -a /dev/dsp1.0 <replaceable>Foobar-GreatestHits.mp3</replaceable></userinput>
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
player. Once installed, specify
the <acronym>MP3</acronym> file to play on the
command line. If the system has multiple audio devices, the
sound device can also be specifed:</para>
<screen>&prompt.root; <userinput>mpg123 <replaceable>-a /dev/dsp1.0 Foobar-GreatestHits.mp3</replaceable></userinput>
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.18.1; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Playing MPEG stream from Foobar-GreatestHits.mp3 ...
MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo</screen>
<para>Additional <acronym>MP3</acronym> players are available in
the &os; Ports Collection.</para>
</sect2>
<sect2 xml:id="rip-cd">
<title>Ripping CD Audio Tracks</title>
<title>Ripping <acronym>CD</acronym> Audio Tracks</title>
<para>Before encoding a CD or CD track to
<acronym>MP3</acronym>, the audio data on the CD must be
ripped to the hard drive. This is done by copying the raw CD
<para>Before encoding a <acronym>CD</acronym> or <acronym>CD</acronym> track to
<acronym>MP3</acronym>, the audio data on the <acronym>CD</acronym> must be
ripped to the hard drive. This is done by copying the raw <acronym>CD</acronym>
Digital Audio (<acronym>CDDA</acronym>) data to
<acronym>WAV</acronym> files.</para>
<para>The <command>cdda2wav</command> tool, which is installed
with the <package>sysutils/cdrtools</package>
suite, is used for ripping audio information from CDs and the
information associated with them.</para>
suite, can be used to rip audio information from
<acronym>CD</acronym>s.</para>
<para>With the audio CD in the drive, the following command can
be issued as <systemitem class="username">root</systemitem> to rip an entire CD
into individual (per track) <acronym>WAV</acronym>
<para>With the audio <acronym>CD</acronym> in the drive, the following command can
be issued as <systemitem class="username">root</systemitem> to rip an entire <acronym>CD</acronym>
into individual, per track, <acronym>WAV</acronym>
files:</para>
<screen>&prompt.root; <userinput>cdda2wav -D <replaceable>0,1,0</replaceable> -B</userinput></screen>
<para>The <option>-D <replaceable>0,1,0</replaceable></option>
indicates the <acronym>SCSI</acronym> device <filename>0,1,0</filename>,
which corresponds to the output of <command>cdrecord
-scanbus</command>.</para>
<para>In this example, the <option>-D <replaceable>0,1,0</replaceable></option>
indicates the <acronym>SCSI</acronym> device
<filename>0,1,0</filename> containing the <acronym>CD</acronym> to rip.
Use <command>cdrecord -scanbus</command> to determine the
correct device parameters for the system.</para>
<para><application>cdda2wav</application> will support ATAPI
(IDE) CDROM drives. To rip from an IDE drive, specify the
device name in place of the <acronym>SCSI</acronym> unit numbers. For example,
to rip track 7 from an IDE drive:</para>
<screen>&prompt.root; <userinput>cdda2wav -D <replaceable>/dev/acd0</replaceable> -t 7</userinput></screen>
<para>To rip individual tracks, make use of the
<option>-t</option> as shown:</para>
<para>To rip individual tracks, use
<option>-t</option> to specify the track:</para>
<screen>&prompt.root; <userinput>cdda2wav -D <replaceable>0,1,0</replaceable> -t 7</userinput></screen>
<para>This example rips track seven of the audio CDROM. To rip
<para>To rip
a range of tracks, such as track one to seven, specify a
range:</para>
<screen>&prompt.root; <userinput>cdda2wav -D <replaceable>0,1,0</replaceable> -t 1+7</userinput></screen>
<para>&man.dd.1; can also be used to extract audio tracks on
ATAPI drives, as described in <xref linkend="duplicating-audiocds"/>.</para>
<para>To rip from an <acronym>ATAPI</acronym>
(<acronym>IDE</acronym>) <acronym>CDROM</acronym> drive, specify the
device name in place of the <acronym>SCSI</acronym> unit numbers. For example,
to rip track 7 from an IDE drive:</para>
<screen>&prompt.root; <userinput>cdda2wav -D <replaceable>/dev/acd0 -t 7</replaceable></userinput></screen>
<para>Alternately, <command>dd</command> can be used to extract audio tracks on
<acronym>ATAPI</acronym> drives, as described in <xref linkend="duplicating-audiocds"/>.</para>
</sect2>
<sect2 xml:id="mp3-encoding">
<title>Encoding MP3s</title>
<title>Encoding and Decoding MP3s</title>
<para>
<application>Lame</application> is a popular
<acronym>MP3</acronym> encoder which can be installed from the
<package>audio/lame</package> port. Due to
licensing restrictions, a package is not available.</para>
patent issues, a package is not available.</para>
<para>The following command will convert the ripped
<acronym>WAV</acronym> files
<acronym>WAV</acronym> file
<filename><replaceable>audio01.wav</replaceable></filename>
to
<filename><replaceable>audio01.mp3</replaceable></filename>:</para>
<screen>&prompt.root; <userinput>lame -h -b <replaceable>128</replaceable> \
--tt "<replaceable>Foo Song Title</replaceable>" \
--ta "<replaceable>FooBar Artist</replaceable>" \
--tl "<replaceable>FooBar Album</replaceable>" \
--ty "<replaceable>2001</replaceable>" \
--tc "<replaceable>Ripped and encoded by Foo</replaceable>" \
--tg "<replaceable>Genre</replaceable>" \
<replaceable>audio01.wav audio01.mp3</replaceable></userinput></screen>
<screen>&prompt.root; <userinput>lame -h -b <replaceable>128</replaceable> --tt "<replaceable>Foo Song Title</replaceable>" --ta "<replaceable>FooBar Artist</replaceable>" --tl "<replaceable>FooBar Album</replaceable>" \
--ty "<replaceable>2014</replaceable>" --tc "<replaceable>Ripped and encoded by Foo</replaceable>" --tg "<replaceable>Genre</replaceable>" <replaceable>audio01.wav audio01.mp3</replaceable></userinput></screen>
<para>128&nbsp;kbits is a standard <acronym>MP3</acronym>
bitrate. The 160 and 192 bitrates provide higher quality.
<para>The specified 128&nbsp;kbits is a standard <acronym>MP3</acronym>
bitrate while the 160 and 192 bitrates provide higher quality.
The higher the bitrate, the larger the size of the resulting
<acronym>MP3</acronym>. <option>-h</option> turns on the
<acronym>MP3</acronym>. The <option>-h</option> turns on the
<quote>higher quality but a little slower</quote> mode. The
options beginning with <option>--t</option> indicate ID3 tags,
options beginning with <option>--t</option> indicate <acronym>ID3</acronym> tags,
which usually contain song information, to be embedded within
the <acronym>MP3</acronym> file. Additional encoding options
can be found in the <application>lame</application> manual
page.</para>
</sect2>
<sect2 xml:id="mp3-decoding">
<title>Decoding MP3s</title>
<para>In order to burn an audio CD from <acronym>MP3</acronym>s,
<para>In order to burn an audio <acronym>CD</acronym> from <acronym>MP3</acronym>s,
they must first be converted to a non-compressed
<acronym>WAV</acronym> format. Both
<application>XMMS</application> and
<application>mpg123</application> support the output of
<acronym>MP3</acronym> to an uncompressed file format.</para>
file format. <application>XMMS</application> can be used to convert to the
<acronym>WAV</acronym> format, while
<application>mpg123</application> can be used to convert to the
raw Pulse-Code Modulation (<acronym>PCM</acronym>) audio data
format.</para>
<para>Writing to Disk in <application>XMMS</application>:</para>
<para>To convert <filename>audio01.mp3</filename>
using <application>mpg123</application>, specify the name of
the <acronym>PCM</acronym> file:</para>
<screen>&prompt.root; <userinput>mpg123 -s <replaceable>audio01.mp3</replaceable> &gt; <replaceable>audio01.pcm</replaceable></userinput></screen>
<para>To use <application>XMMS</application> to convert a
<acronym>MP3</acronym> to <acronym>WAV</acronym> format, use
these steps:</para>
<procedure>
<title>Converting to <acronym>WAV</acronym> Format in <application>XMMS</application></title>
<step>
<para>Launch <application>XMMS</application>.</para>
</step>
@ -683,34 +669,20 @@ MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo</screen>
</step>
</procedure>
<para>Writing to stdout in
<application>mpg123</application>:</para>
<procedure>
<step>
<para>Run <command>mpg123 -s
<replaceable>audio01.mp3</replaceable> &gt;
<replaceable>audio01.pcm</replaceable></command></para>
</step>
</procedure>
<para><application>XMMS</application> writes a file in the
<acronym>WAV</acronym> format, while
<application>mpg123</application> converts the
<acronym>MP3</acronym> into raw PCM audio data. Both of these
<para>Both the <acronym>WAV</acronym> and <acronym>PCM</acronym>
formats can be used with <application>cdrecord</application>
to create audio CDs, whereas &man.burncd.8; requires a raw
Pulse-Code Modulation (<acronym>PCM</acronym>). When using
to create audio <acronym>CD</acronym>s, whereas <application>burncd</application> requires the
<acronym>PCM</acronym> format. When using
<acronym>WAV</acronym> files, there will be a small tick
sound at the beginning of each track. This sound is the
header of the <acronym>WAV</acronym> file. One can remove the
header with <application>SoX</application>, which can be
installed from the <package>audio/sox</package> port or package:</para>
header of the <acronym>WAV</acronym> file. The
<package>audio/sox</package> port or package can be used to remove the
header:</para>
<screen>&prompt.user; <userinput>sox -t wav -r 44100 -s -w -c 2 <replaceable>track.wav track.raw</replaceable></userinput></screen>
<para>Refer to <xref linkend="creating-cds"/> for more
information on using a CD burner in &os;.</para>
information on using a <acronym>CD</acronym> burner in &os;.</para>
</sect2>
</sect1>