audiotools.cdio — the CD Input/Output Module

The audiotools.cdio module contains the CDDAReader class for accessing raw CDDA data.

CDDAReader Objects

class audiotools.cdio.CDDAReader(device[, perform_logging])

A audiotools.PCMReader object which treats the CD audio as a single continuous stream of audio data. device may be a physical CD device (like /dev/cdrom) or a CD image file (like CDImage.cue). If perform_logging is indicated and device is a physical drive, reads will perform logging.


The sample rate of this stream, always 44100.


The channel count of this stream, always 2.


This channel mask of this stream, always 3.


The bits-per-sample of this stream, always 16.

Try to read a pcm.FrameList object with the given number of PCM frames, if possible. This method will return sector-aligned chunks of data, each divisible by 588 frames. Once the end of the CD is reached, subsequent calls will return empty FrameLists.

May raise IOError if a problem occurs reading the CD.

Try to seek to the given absolute position on the disc as a PCM frame value. Returns the position actually reached as a PCM frame value. This method will always seek to a sector-aligned position, each divisible by 588 frames.


Closes the stream for further reading. Subsequent calls to and will raise ValueError.


Whether the disc is a physical device or CD image. This is useful for determining whether disc read offset should be applied.


The first sector of the disc as an integer. This is mostly for calculating disc IDs for various lookup services.


The last sector of the disc as an integer.


A dict whose keys are track numbers and whose values are the lengths of those tracks in PCM frames.


A disc whose keys are track numbers and whose values are the offsets of those tracks in PCM frames.


Sets the reading speed of the drive to the given integer. This has no effect on CD images.


Returns the read log as a dictionary. If logging is active, these values will be updated on each call to If logging is inactive or not supported, all values will be 0.


Resets all log values to 0. This is useful if one wants to get the log values for many tracks individually.

Table Of Contents

Previous topic

audiotools.replaygain — the ReplayGain Calculation Module

Next topic

audiotools.dvda — the DVD-Audio Input/Output Module

This Page