本文介绍了的Python:什么是从各种格式的音频加载的元数据功能最丰富的图书馆吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一个良好的,功能丰富,库各种音频格式(MP3,FLAC,OGG,WAV等)读取元数据。我已经看了诱变剂,但文档是几乎不存在,它似乎无法加载基本信息,如艺术家和音频标题。

I'm looking for a good, feature-rich, library for reading metadata from various audio formats (MP3, FLAC, OGG, WAV, etc.). I have already looked at Mutagen, but the documentation is nearly nonexistent, and it seems incapable of loading basic information such as artist and audio title.

推荐答案

另一个绑定基于标签库(也许是相同的python-标签库?)叫tagpy由Andreas - 。我用它前一段时间,这不是坏...以下粗略code应该给你一个想法如何从一个文件复制标签其他(因此任何其他操作)

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()

这篇关于的Python:什么是从各种格式的音频加载的元数据功能最丰富的图书馆吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 03:54