Read and write FLAC Vorbis comments and stream information.
Read more about FLAC at http://flac.sourceforge.net.
FLAC supports arbitrary metadata blocks. The two most interesting ones are the FLAC stream information block, and the Vorbis comment block; these are also the only ones Mutagen can currently read.
This module does not handle Ogg FLAC files.
Based off documentation available at http://flac.sourceforge.net/format.html
- class mutagen.flac.FLAC(filething)
A FLAC audio file.
filething (filething) –
- static score(filename, fileobj, header_data)
Returns a score for how likely the file can be parsed by this type.
- negative if definitely not a matching type, otherwise a score,
the bigger the more certain that the file can be loaded.
- Return type:
Add a Vorbis comment block to the file.
Remove Vorbis comments from a file.
If no filename is given, the one most recently loaded is used.
Delete all pictures from the file.
- class mutagen.flac.StreamInfo
FLAC stream information.
This contains information about the audio data in the FLAC file. Unlike most stream information objects in Mutagen, changes to this one will rewritten to the file when it is saved. Unless you are actually changing the audio stream itself, don’t change any attributes of this block.
- class mutagen.flac.Picture
Read and write FLAC embed pictures.
To create a picture from file (in order to add to a FLAC file), instantiate this object without passing anything to the constructor and then set the properties manually:
p = Picture() with open("Folder.jpg", "rb") as f: pic.data = f.read() pic.type = id3.PictureType.COVER_FRONT pic.mime = u"image/jpeg" pic.width = 500 pic.height = 500 pic.depth = 16 # color depth
- class mutagen.flac.CueSheet
Read and write FLAC embedded cue sheets.
Number of tracks should be from 1 to 100. There should always be exactly one lead-out track and that track must be the last track in the cue sheet.
- class mutagen.flac.CueSheetTrack
A track in a cuesheet.
For CD-DA, track_numbers must be 1-99, or 170 for the lead-out. Track_numbers must be unique within a cue sheet. There must be at least one index in every track except the lead-out track which must have none.
- class mutagen.flac.CueSheetTrackIndex(index_number, index_offset)
Index for a track in a cuesheet.
For CD-DA, an index_number of 0 corresponds to the track pre-gap. The first index in a track must have a number of 0 or 1, and subsequently, index_numbers must increase by 1. Index_numbers must be unique within a track. And index_offset must be evenly divisible by 588 samples.