Python: What is the most feature-rich library for loading audio metadata from various formats?

筅森魡賤 提交于 2019-12-04 11:20:19

Are the artist and audio title encoded properly? What particular formats is it failing one - often ID3 information is poorly encoded.

http://wiki.python.org/moin/UsefulModules#ID3Handling (A List of ID3 modules)

I would try ID3Reader, which has support for ID3v1, which Mutagen seems to be missing.

see taglib and it's python bindings

another binding based on taglib (maybe the same as python-taglib?) called tagpy by Andreas -- http://mathema.tician.de/software/tagpy . I used it a while ago, and it's not bad... the following rough code should give you an idea how to copy tags from one file to the other (thus any other manipulation)

def copy_tags(src_file, dst_file): # args both strings
    tag0 = tagpy.FileRef(src_file).file().tag()
    file1 = tagpy.FileRef(dst_file)
    tag1 = file1.file().tag()
    for info in ['album', 'artist', 'comment', 'genre', 'title', 'track', 'year']:
        setattr(tag1, info, getattr(tag0, info))
    print file1.save()

gstreamer is also an excellent option, if you don't mind the gnome dependency and a bit more effort coding. it supports just about every filetype known to man.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!