2010-07-01 63 views
0

我剛用誘變起步,並沒有succefully與M4AMP3AFSFLAC使用它。然而,我有困難與OggFileType類,當我嘗試創建一個OggFileType Im的實例呈現"TypeError: 'NoneType' object is not callable"異常。誘變劑的OggFileType生產 '類型錯誤:NoneType' 例外

Iv搜索和搜索解決方案,但有關誘變劑的信息和文檔很少。任何幫助,將不勝感激。

我使用的代碼的測試

path = "I:\Music\Various Artists\Studio One Classics" 
audiofile = "16 - Rub A Dub Style.ogg" 
os.chdir(path) 
OggTag = OggFileType(audiofile) 
print OggTag 

跟蹤信息片斷

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 

回答

1

你不應該直接使用OggFileType。它是其他Ogg格式類的基類 - OggVorbis,OggTheora等。這些都適當地設置_Info,_Tags,_Error。這是在ogg.py模塊的文檔中註明的:

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

我確定我已經閱讀過該文檔字符串 - 顯然不是。謝謝 – volting 2010-07-01 18:27:45

相關問題