CDDA2WAV(1)

NAME
cdda2wav - a sampling utility that dumps cd audio data into wav sound files

SYNOPSIS
cdda2wav [-c chans] [-s] [-m] [-b bits] [-r rate] [-t track] [-o offset] [-D device] [-I interface] [-max] [-v] [-i] [-e] [-n] [wavfile.wav]

DESCRIPTION
cdda2wav works with cdrom drives (eg toshiba 3401, 4101 and 3501) that are capable of reading audio data digitally to the host (cdda). Other drives may have been added as well when you read this.

OPTIONS
options:
-c channels : set 1 for mono, or 2 for stereo recording.
-D device : use device as cdrom drive.
-I interface: specify the interface for cdrom access.
            (generic_scsi or cooked_ioctl or scsi_ioctl).
-s
        : set to stereo recording.
-m
        : set to mono recording.
-max
        : set maximum (cd) quality.
-b bits : set bits per sample per channel: 8, 12 or 16
-r rate : set rate in samples per second.
        Possible values are: 44100, 22050, 14700, 11025,
        7350, 3675, 3150, 1575 or 900 Hertz.
-t track : select start track.
-i track : select start index.
-o offset : start 'offset' sectors behind start track.
                       one sector equivalents 1/75 second.
-d duration : set recording time in seconds or
        0 for whole track.
-w
        : wait for signal, then start recording.
-e
        : copy audio data to sound device eg /dev/dsp
-v
        : print verbose information about the cd
-n
        : don't write to file, just read (for debugging)
-q
        : quiet operation, no screen output.
defaults:
mono, 16 bit, 22050 Hz, track 1, no offset, 16 seconds, 'audio.wav', don't wait for signal, not quiet, not verbose

MORE EXPLANATION ON OPTIONS AND USAGE HINTS
cdda2wav is able to read parts of an AUDIO or multimedia cdrom (containing AUDIO parts) directly digitally. These parts can be written into a file, or a sound device. cdda2wav stands for CDDA to WAV (where CDDA stands for compact disc digital audio and WAV is another sound sample format introduced by MSDOS Windows 3.1). It allows copying CDDA audio data from the cdrom drive into a file on your ram-, hard-, floppy- or whatever-disk in the very common WAV format (notice that sampling has not to be done in realtime here, data is read on request). If your cdrom is on device /dev/sr0 and it is loaded with an audio cd, you may simply invoke 'cdda2wav' and it will create the sound file audio.wav recording 16 seconds beginning with track 1 in mono at 16 bit at 22050 Hz sample rate, if your file system has 705644 bytes free. Otherwise recording time will be limited. Table of Contents
=================
The display will show the table of contents with number of tracks and total time (displayed in mm:ss.hh format, mm = minutes, ss = seconds, hh = 1/100 seconds). The following list displays track number and track time for each entry. Recording display
=================
During recording a time display shows the current position in a minutes:seconds:frames format. The displayed time is always related to start of the track. On some configuration there is an optional display for track and indexing information. Less information is available via the -q option (see below). Options
=======
Most of the options are used to control the format of the WAV file. In the following text all of them are described. Select Device
=============
-D
device    select the cdrom drive (scsi) device. Default is
        is currently /dev/sgb. It should correpond to the selected
            interface (see below). Select Interface
================
-I interface select the cdrom drive interface. For scsi drives here are two possible choices: generic_scsi and scsi_ioctl. The first uses the generic scsi interface, the latter uses the ioctl of the scsi cdrom driver. For other drives is has to be cooked_ioctl. This works only when the kernel driver supports cdda reading. Default is is currently generic_scsi. This has to fit to the selected cdrom device (see above). Enable echo to soundcard
========================
-e
[cho]    copy audio data to sound card while recording, so you hear
it nearly simultanously. The soundcard gets the same data that is recorded. This is time critical, so it works best with the -q option. To use cdda2wav as a pseudo cd player without recording in a file you could use
    cdda2wav -q -e -t2 -d0 -n
to play the whole second track. Select mono or stereo recording
===============================
-m
[ono]    or
-c [hannels] 1
    selects mono recording (both stereo channels are mixed) -s
[tereo]    or
-c [hannels] 2
    selects stereo recording (doubles file size) Select maximum quality
======================
-max
        will set stereo, 16 bits per sample at 44.1 KHz
        (full cd quality). Note that other format options given later do change this setting. Select sample quality
=====================
-b
[its]  8    specifies 8 bit (1 Byte) for each sample in each channel
-b
[its] 12    specifies 12 bit (2 Byte) for each sample in each channel
-b
[its] 16    specifies 16 bit (2 Byte) for each sample in each channel
(Ensure that your sample player or sound card is capable of playing 12-bit or 16-bit samples). Selecting 12 or 16 bits doubles file size. 12-bit samples are aligned to 16-bit samples, so they waste some disk space. Select sample rate
==================
-r
[ate] samplerate    selects a sample rate
samplerate may be any value out of the following ones:
            44100,22050,14700,11025,7350,3675,3150,1575 or 900. These sample rates may seem rather randomly choosen, but there is a deeper sense in them. At first all the rates are dividable by 44100 Hertz (the audio cd sampling rate), dividends are 1, 2, 3, 4, 6, 12, 14, 28 and 49. To make the sound smoother at lower sampling rates, cdda2wav sums over n samples (where n is the specific dividend). So for 22050 Hertz output we have to sum over 2 samples, for 900 Hertz we have to sum over 49 samples. This cancels higher frequencies. Standard sector size of an audio cd (ignoring additional information) is 2352 Bytes. In order to finish summing for an output sample at sector boundaries the rates above have to be choosen. Arbitrary sampling rates in high quality would require some interpolation scheme, which needs much more sophisticated programming. Select start track
==================
-t
[rack] n    select one of the tracks displayed in the table of contents
This sets the track where recording begins, but recording can advance through the following tracks as well (depending on recording time). Select start index
==================
-i
[ndex] n    select the index to start recording with.
Indices other than 1 will invoke the index scanner, which will take some time to find the correct start position. An offset may be given additionally
 (see below).. Set recording time
==================
-d
[uration]    n    set recording time to n seconds    or
            set recording time for whole track (n = 0) Recording time is defined as the time the generated sample will play (at the defined sample rate). Since it's related to the amount of generated samples,
 it's not the time of the sampling process itself (which can be greater). It's neither strictly coupled with the time information on the audio cd (shown by your hifi cd player and cdda2wav's display). Differences can occur by the usage of the -o option (see below). Notice that recording time will be limited, unless enough disk space exists. Recording can be aborted at anytime by pressing Control-C. Set start sector offset
=======================
-o
[ffset] sectors    increments start sector of the track by sectors
By this option you are able to skip a certain amount at the beginning of a track so you can pick exactly the part you want. Each sector runs 1/75 second, so you have very fine control. If your offset is so high that it would not fit into the current track, a warning message is issued and the offset is ignored. Recording time is not reduced. (To skip introductory quiet passages automagically, use the -w option see below.) Wait for signal option
======================
-w [ait] Turning on this option will suppress all silent output at startup, reducing possibly file size. Cdda2wav will watch for any signal in the output signal and switches on writing to file. Verbose option
==============
-v [erbose] prints information from sub-q-channel of the table of contents. One line per track describes the type. track preemphasis copypermitted tracktype chans subQchan
        The track column holds the track number.
        'Pre-Emphasis' shows if that track has been
        given a non linear frequency response.
        'Copy-permitted' indicates if this track is free
        of copyrights.
        'Tracktype' can be data or audio. On multimedia
        cds there should be both of them available.
        'Channels' is defined for audio tracks only.
        There can be two or four channels.
        'sub-Q-channel' indicates the type of additional
        information present in the sub-Q-channel.
        This can be a position, a media catalog number
        or an international standard recording code. Information only option
=======================
-i
[nformation]    this option suppresses sampling and set the verbose option.
All information of the TOC is supplied. No file output
==============
-n
[ofile]    this debugging option switches off writing to a file.
Quiet option
============
-q
[uiet]    suppress all screen output except error messages. Further it
        avoids any sub q channel requests for position reports in the
        recording display. That reduces cpu time resources and allows
        feeding a soundcard with audio data on the fly. Hints
=====
Don't create samples you cannot read. First check your sample player software and sound card hardware. I experienced problems with very low sample rates (stereo <= 1575 Hz, mono <= 3675 Hz) when trying to play them with standard WAV players for sound blaster (may be they are not legal in WAV format). Conversion to other sound formats can be done using the sox program package. If you really want to sample more than one track in one file, this is currently possible with the -d[uration] option. When recording time exceeds the track limit the next track will be recorded too.

WARNING
IMPORTANT: It is prohibited to sell copies of copyrighted material. This
    program may not be used to circumvent copyrights.

BUGS
A kernel bug (version < 1.1.20) prevented succesful operation of mode select commands.
Performance may not be optimal on slower systems.
The index scanner may give timeouts.

ACKNOWLEDGEMENTS
Thanks to Rammi for debugging and hearing 100 times the first 16 seconds of the first track of the Krupps cd bravely.

AUTHOR
Heiko Eissfeldt and Olaf Kindel heiko@colossus.escape.de

DATE
16. October 1994