Ogg Vorbis

Read and write Ogg Vorbis comments.

This module handles Vorbis files wrapped in an Ogg bitstream. The first Vorbis stream found is used.

Read more about Ogg Vorbis at http://vorbis.com/. This module is based on the specification at http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html.

class mutagen.oggvorbis.OggVorbis(filething)

Bases: mutagen.ogg.OggFileType

Parameters:filething (filething) –

An Ogg Vorbis file.

info
Type:OggVorbisInfo
tags
Type:mutagen._vorbis.VCommentDict
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.oggvorbis.OggVorbisInfo

Bases: mutagen.StreamInfo

Ogg Vorbis stream information.

length

File length in seconds, as a float

Type:float
channels

Number of channels

Type:int
bitrate

Nominal (‘average’) bitrate in bits per second

Type:int
sample_rate

Sample rate in Hz

Type:int
pprint()

Returns: text: Print stream information