Musepack

Musepack audio streams with APEv2 tags.

Musepack is an audio format originally based on the MPEG-1 Layer-2 algorithms. Stream versions 4 through 7 are supported.

For more information, see http://www.musepack.net/.

class mutagen.musepack.Musepack(filething)

Bases: mutagen.apev2.APEv2File

Parameters:filething (filething) –
info

MusepackInfo

static score(filename, fileobj, header)

Returns a score for how likely the file can be parsed by this type.

Parameters:
  • filename (fspath) – a file path
  • fileobj (fileobj) – a file object open in rb mode. Position is undefined
  • header (bytes) – data of undefined length, starts with the start of the file.
Returns:

negative if definitely not a matching type, otherwise a score,

the bigger the more certain that the file can be loaded.

Return type:

int

class mutagen.musepack.MusepackInfo

Bases: mutagen.StreamInfo

Musepack stream information.

channels

int – number of audio channels

length

float – file length in seconds, as a float

sample_rate

int – audio sampling rate in Hz

bitrate

int – audio bitrate, in bits per second

version

int

Optional Attributes:

title_gain

float – Replay Gain for this song

title_peak

float – Peak data for this song

album_gain

float – Replay Gain for this album

album_peak

float – Peak data for this album

These attributes are only available in stream version 7/8. The gains are a float, +/- some dB. The peaks are a percentage [0..1] of the maximum amplitude. This means to get a number comparable to VorbisGain, you must multiply the peak by 2.

pprint()

Returns: text: Print stream information