ASF

Read and write ASF (Window Media Audio) files.

class mutagen.asf.ASF(filething)

Bases: mutagen.FileType

An ASF file, probably containing WMA or WMV.

Parameters:filething (filething) –
info

ASFInfo

tags

ASFTags

load(filething)
Parameters:filething (filething) –
Raises:mutagen.MutagenError
save(filething=None, padding=None)

Save tag changes back to the loaded file.

Parameters:
Raises:

mutagen.MutagenError

delete(filething=None)
Parameters:filething (filething) –
Raises:mutagen.MutagenError
class mutagen.asf.ASFInfo

Bases: mutagen.StreamInfo

ASF stream information.

length

float

“Length in seconds

sample_rate

int

Sample rate in Hz

bitrate

int

Bitrate in bps

channels

int

Number of channels

codec_type

mutagen.text

Name of the codec type of the first audio stream or an empty string if unknown. Example: Windows Media Audio 9 Standard

codec_name

mutagen.text

Name and maybe version of the codec used. Example: Windows Media Audio 9.1

codec_description

mutagen.text

Further information on the codec used. Example: 64 kbps, 48 kHz, stereo 2-pass CBR

pprint()

Returns: text: a stream information text summary

class mutagen.asf.ASFTags

Bases: list, mutagen._util.DictMixin, mutagen.Tags

Dictionary containing ASF attributes.

__getitem__(key)

A list of values for the key.

This is a copy, so comment[‘title’].append(‘a title’) will not work.

__delitem__(key)

Delete all values associated with the key.

__contains__(key)

Return true if the key has any values.

__setitem__(key, values)

Set a key’s value or values.

Setting a value overwrites all old ones. The value may be a list of Unicode or UTF-8 strings, or a single Unicode or UTF-8 string.

keys()

Return a sequence of all keys in the comment.

as_dict()

Return a copy of the comment data in a real dict.

pprint()

Returns a string containing all key, value pairs.

Return type:text
class mutagen.asf.ASFBaseAttribute

Generic attribute.

language = None

Language

stream = None

Stream

value = None

The Python value of this attribute (type depends on the class)

class mutagen.asf.ASFBoolAttribute(value)

Bool attribute.

ASFBoolAttribute(True)
Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFGUIDAttribute(value)

GUID attribute.

Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFWordAttribute(value)

WORD attribute.

ASFWordAttribute(42)
Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFDWordAttribute(value)

DWORD attribute.

ASFDWordAttribute(42)
Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFQWordAttribute(value)

QWORD attribute.

ASFQWordAttribute(42)
Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFBoolAttribute(value)

Bool attribute.

ASFBoolAttribute(True)
Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFByteArrayAttribute(value)

Byte array attribute.

ASFByteArrayAttribute(b'1234')
Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFUnicodeAttribute(value)

Unicode string attribute.

ASFUnicodeAttribute(u'some text')
Bases:ASFBaseAttribute
__hash__
class mutagen.asf.ASFUnicodeAttribute(value)

Unicode string attribute.

ASFUnicodeAttribute(u'some text')
Bases:ASFBaseAttribute
__hash__