MP3¶
MPEG audio stream information and tags.
-
class
mutagen.mp3.MP3(filename, ID3=None)¶ Bases:
mutagen.id3.ID3FileTypeAn MPEG audio (usually MPEG-1 Layer 3) file.
Variables:
-
class
mutagen.mp3.MPEGInfo¶ MPEG audio stream information
Parse information about an MPEG audio file. This also reads the Xing VBR header format.
This code was implemented based on the format documentation at http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm.
Useful attributes:
length – audio length, in seconds
channels – number of audio channels
bitrate – audio bitrate, in bits per second
sketchy – if true, the file may not be valid MPEG audio
- encoder_info – a string containing encoder name and possibly version.
In case a lame tag is present this will start with
"LAME ", if unknown it is empty, otherwise the text format is undefined.
bitrate_mode – a
BitrateModetrack_gain – replaygain track gain (89db) or None
track_peak – replaygain track peak or None
album_gain – replaygain album gain (89db) or None
Useless attributes:
- version – MPEG version (1, 2, 2.5)
- layer – 1, 2, or 3
- mode – One of STEREO, JOINTSTEREO, DUALCHANNEL, or MONO (0-3)
- protected – whether or not the file is “protected”
- padding – whether or not audio frames are padded
- sample_rate – audio sample rate, in Hz