[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Audio compact discs can be played on systems that have a CD-ROM drive and sound card installed. You can control playback of an audio CD in all the ways you can with a traditional CD player, except on a Linux system you control playback with software tools on the command line. There are tools for reading the audio data from a CD and writing it to a file (which you can later write to a CD-R disc, or convert to MP3 format).
Tools and techniques for manipulating CD-ROMs (data CDs) are in CD-ROMs.
23.1 Controlling CD Audio Controlling CD audio. 23.2 Sampling Sound from a CD Making a sample of an audio CD. 23.3 Writing an Audio CD-R Writing a CD-R. 23.4 Other Audio CD Applications More CD tools and applications.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
@sf{Debian}: `cdtool' @sf{WWW}: ftp://jaka.cerl.uiuc.edu/pub/tinsel/
23.1.1 Playing an Audio CD Playing an audio CD. 23.1.2 Pausing an Audio CD Pausing an audio CD. 23.1.3 Stopping an Audio CD Stopping an audio CD. 23.1.4 Shuffling Audio CD Tracks Shuffling tracks. 23.1.5 Displaying Information about an Audio CD Getting information on the current CD. 23.1.6 Ejecting an Audio CD Ejecting a disc.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use cdplay
to play an audio CD in the CD-ROM drive; the sound is
output through the speakers connected to the LINE OUT jack on your sound
card. (You may need to use the audio mixer to adjust the volume level
and other settings; see Adjusting the Audio Controls.)
$ cdplay RET |
To begin with a particular track, give the number of the track as an argument.
$ cdplay 3 RET |
To end with a particular track, give the number of the track as a second argument.
$ cdplay 1 4 RET |
$ cdplay 3 3 RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use cdpause
to pause audio CD playback.
$ cdpause RET |
Use cdplay
to start playback at the point where it was paused; to
restart the playback from the beginning, use cdplay
with `x'
as an argument.
$ cdplay RET |
$ cdplay x RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To stop playback of an audio CD, use cdstop
.
$ cdstop RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use cdplay
with the `shuffle' argument to play the CD tracks
in random order.
$ cdplay shuffle RET |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use cdinfo
to display information about an audio CD, including
its play status and track times. With no options, it outputs the play
status: `play' if the CD is currently playing, `paused' if the
CD is currently on pause, `no-status' if the CD is not playing, and
`nodisc' if no disc is in the drive.
$ cdinfo RET |
In addition, cdinfo
recognizes the following options:
OPTION | DESCRIPTION |
-a |
Output the absolute disc time. |
-r |
Output the relative track time. |
-s |
Output the play status (the default action). |
-t |
Output the current track. |
-v |
Output all available information: play status, current track, absolute disc time, and relative track time. |
To show the lengths of all tracks on an audio CD in a directory-like
format, use cdir
. This tool will also show titles and artist
names, if known, but for this to work, you must set up an audio CD
database (see the cdtool
man
page for details---Reading a Page from the System Manual).
$ cdir RET unknown cd - 43:14 in 8 tracks 5:15.00 1 5:50.40 2 5:29.08 3 3:50.70 4 4:17.00 5 5:56.15 6 7:13.40 7 5:19.22 8 $ |
In this example, the CD contains eight tracks, with a total of 43 minutes and 14 seconds play time.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use cdeject
to eject the disc in the CD-ROM drive. If the disc is
currently playing, play will stop and the disc will eject.
$ cdeject RET |
NOTE: This command will also eject a CD-ROM (data CD), if the CD-ROM is not currently mounted (see section CD-ROMs).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
@sf{Debian}: `cdda2wav' @sf{Debian}: `cdparanoia' @sf{WWW}: ftp://ftp.gwdg.de/pub/linux/misc/cdda2wav/ @sf{WWW}: http://www.mit.edu/afs/sipb/user/xiphmont/cdparanoia/index.html
cdda2wav
and cdparanoia
. Both can retrieve
single tracks or entire disks; the former is the archetypal CD
audio-sampling tool for Linux, and should be used when speed is more
important than sound quality. The latter does various extra checks for
the paranoid, and should be used when an absolutely perfect copy is
necessary--at the expense of speed. cdda2wav
is perfectly
capable of creating a digitally perfect audio sample; cdparanoia
is useful for when your original CD may have scratches (its scratch
detection capability can attempt to "hold sync" across the scratch),
or for when you are using a less-than-optimal-quality CD-ROM drive.
With cdda2wav
, you specify the track number to be retrieved as an
argument to the `-t' option; use `x' to specify a CD-quality
retrieval, and give the name of the CD-ROM device with the `-D'
option--unless you have multiple CD-ROM drives installed, this is
almost certainly going to be `/dev/cdrom'.
By default, files are written as WAV format files; use the `-O'
option followed by `cdr' to write the files in CD audio
format. `.cdr' files are useful for burning an audio CD containing
the files as tracks (discussed in the following section), and
`.wav' files are useful for converting to MP3 format
(see section Making an MP3 File). You can convert either
format to the other at a later time with sox
---see
Converting Sound Files.
$ cdda2wav -t7 -d0 -x -D /dev/cdrom RET |
$ cdda2wav -D /dev/cdrom -x -O cdr -d0 -B RET |
For more reliable sampling, use cdparanoia
. Give the range of
audio tracks to sample as an argument (with no arguments, it samples the
entire disc). Use the `-w' option to specify WAV format output.
$ cdparanoia -w 3-3 RET |
$ cdparanoia -w -B RET |
$ cdparanoia -B -Y -X RET |
NOTE: Sampling an entire audio CD can use a lot of disk space; most people delete the `.cdr' or `.wav' files as soon as they make MP3s or burn an audio CD-R from the data.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
@sf{Debian}: `cdrecord' @sf{WWW}: http://freshmeat.net/projects/cdrecord/
Specify the CD-R drive with the special `dev' argument, which is given in this form:
`dev=scsibus,target,lun' |
where scsibus is the number of the SCSI bus (0 for the primary bus), target is the SCSI target ID (usually a number from 1 to 6), and lun is its LUN number (most always 0).
Use the `speed' argument to set the speed factor for writing data: give `speed=2' to specify double speed or `speed=4' to specify quad speed.
Use the `-dummy' option to run with the drive laser turned off, so no actual burning takes place; this is useful when you are first using a CD-R drive and need to test your configuration to make sure you've got it right. Another useful option is `-v', which gives a more verbose message output.
Give the names of the audio files to burn, in the order that they should appear on the disc, as arguments to the `-audio' option. The files are written in CD-DA CD audio format, and they should contain 16-bit stereo at 44,100 samples/second (the `.cdr' or `.cdda' files meet this criterion).
$ cdrecord dev=0,2,0 -audio symphony.cdr RET |
$ cdrecord dev=0,2,0 speed=2 -v -audio *.cdr RET |
$ cdrecord dev=0,6,1 -dummy -audio symphony.cdr RET |
When you use wildcards for files, as in the second-to-the-last example, the shell expands the files in alphabetical order. To write a group of tracks in a particular order without specifying all of their names as arguments, rename them so that their names begin with numbers that correspond to the order you want to write them in (see section Moving Files and Directories).
For example, if you have the three files `morning-song.cdr', `midday-song.cdr', and `evening-song.cdr', and you want to write them in that order, rename the files to `01-morning-song.cdr', `02-midday-song.cdr', and `03-evening-song.cdr'; otherwise, if you specify them as `*.cdr', the shell will sort their names so that they will be written to CD-R in the order of `evening-song.cdr', `midday-song.cdr', and `morning-song.cdr'---exactly the opposite of what was intended!
To write a disc containing both data and audio tracks, first specify the file for the data track (it should contain a filesystem image in either ISO 9660 or Rock Ridge format), and then follow it with the `-audio' option and the names of the audio tracks to use. The resulting CD-R will be both mountable as a data CD and playable on audio CD players (the first track on the disc, the data track, will be skipped when playing the audio).
$ cdrecord dev=0,2,0 band-info -audio *.cdda RET |
NOTE: When writing an audio CD, you should have as few
processes running as possible. If cdrecord
has to pause even
momentarily to let the system shuffle other processes, the CD-R could be
ruined! For this reason, it is advisable to avoid switching between
consoles--or between windows, if running X--during the CD-R burning
process.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following table lists some of the other available tools and applications that work on audio compact discs.
TOOL | DESCRIPTION |
dynamic |
Project Dynamic is a tool for playing samples of audio CDs; it is distinctive in that it can play audio CDs backwards. {@sf{WWW}}: http://www.cse.unsw.edu.au/~flatmax/dynamic/ |
workbone |
An interactive CD player that can be used on the console or in X; it allows you to skip forward and backward through tracks as they are playing. |
workman |
A tool for playing audio CDs, with a graphical interface that looks like the front panel of a physical CD player. |
xcdroast |
XCDRoast is a graphical front-end to the cdrecord tool for
use in X.
{@sf{WWW}}: http://www.xcdroast.org/
|
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |