在 Android 中从 Mp3 检索元数据的最佳方法
我一直在为 Android 开发一个小型媒体播放器应用程序。我在从音乐文件检索元数据时遇到一些问题。我一直在使用MediaMetadataRetriever,但事实证明它相当麻烦。有谁知道更好的方法来解决这个问题?如果是这样,如何实现这样的方法?
I've been working on a small media player app for Android. I'm having some trouble retrieving the meta data from the music files. I've been using the MediaMetadataRetriever, but it has proved to be quite troublesome. Does anyone know of a better way to go about this? If so how would one implement such method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用了
JAudioTagger
,您可以在此处找到它。它支持(基本上)ID3 的每个版本,因此即使对于具有过时元数据的旧文件,您也能得到保护。非常好的(而且简单)的解决方案。其他选项包括 mp3agic 和 已标记。I've used
JAudioTagger
, which you can find here. It supports (basically) every version of ID3, so you're covered even for old files with outdated metadata. Pretty good (and easy) solution. Other options include mp3agic and entagged.我能够从 Android 数据库读取元数据, 使用此处的代码。只需更改 托管查询 类似于:
这将光标返回到元数据
文件
。 (作者、标题、持续时间等)I was able to read the metadata from the Android database, using the code here. Just change the managedquery to something like:
This returns a cursor to the metadata of
file
. (Author, Title, duration etc.)