开发者

Mutagen's OggFileType producing 'Type Error: NoneType' exception

Ive just started using mutagen and have succefully used it with m4a, mp3, ape, afs, and flac. However Im having difficulty with the OggFileType class, when I try to create an instance of OggFileType Im presented with a "TypeError: 'NoneType' object is not callable" exception.

Iv searched and searched for solutions but information and documentation on mutagen is scarce. Any help would be appreciated thanks.

A snippet of the code I am using for testing

path = "I:\Music\Variou开发者_开发问答s Artists\Studio One Classics"
audiofile = "16 - Rub A Dub Style.ogg"
os.chdir(path)
OggTag = OggFileType(audiofile)
print OggTag

Traceback

Traceback (most recent call last):
  File "I:\My Documents\Programming\python\music_organizer\mutagen_test.py", line 203, in <module>
    OggTag = OggFileType(audiofile)
  File "C:\Python26\lib\site-packages\mutagen\__init__.py", line 75, in __init__
    self.load(filename, *args, **kwargs)
  File "C:\Python26\lib\site-packages\mutagen\ogg.py", line 441, in load
    self.info = self._Info(fileobj)
TypeError: 'NoneType' object is not callable


You're not supposed to use OggFileType directly. It's a base class for the other Ogg format classes -- OggVorbis, OggTheora, etc. Those all properly set _Info, _Tags, _Error appropriately. This is noted in the documentation for the ogg.py module:

Read and write Ogg bitstreams and pages.

This module reads and writes a subset of the Ogg bitstream format version 0. It does not read or write Ogg Vorbis files! For that, you should use mutagen.oggvorbis.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜