audiotools.cue — the Cuesheet Parsing Module

The audiotools.cue module contains the Cuesheet class used for parsing and building cuesheet files representing CD images.

audiotools.cue.read_cuesheet(filename)

Takes a filename string and returns a new Cuesheet object. Raises CueException if some error occurs when reading the file.

exception audiotools.cue.CueException

A subclass of audiotools.SheetException raised when some parsing or reading error occurs when reading a cuesheet file.

Cuesheet Objects

class audiotools.cue.Cuesheet

This class is used to represent a .cue file. It is not meant to be instantiated directly but returned from the read_cuesheet() function. The __str__() value of a Cuesheet corresponds to a formatted file on disk.

Cuesheet.catalog()

Returns the cuesheet’s catalog number as a plain string, or None if the cuesheet contains no catalog number.

Cuesheet.single_file_type()

Returns True if the cuesheet is formatted for a single input file. Returns False if the cuesheet is formatted for several individual tracks.

Cuesheet.indexes()

Returns an iterator of index lists. Each index is a tuple of CD sectors corresponding to a track’s offset on disk.

Cuesheet.pcm_lengths(total_length, sample_rate)

Takes the total length of the entire CD, in PCM frames, and the sample rate of the stream, in Hz. Returns a list of PCM frame lengths for all audio tracks within the cuesheet. This list of lengths can be used to split a single CD image file into several individual tracks.

Cuesheet.ISRCs()

Returns a dictionary of track_number -> ISRC values for all tracks whose ISRC value is not empty.

classmethod Cuesheet.file(sheet, filename)

Takes a Cuesheet-compatible object with catalog(), indexes(), ISRCs() methods along with a filename string. Returns a new Cuesheet object. This is used to convert other sort of Cuesheet-like objects into actual Cuesheets.

Table Of Contents

Previous topic

audiotools.accuraterip — AccurateRip Lookup Service Module

Next topic

audiotools.toc — the TOC File Parsing Module

This Page