Android - 从 mp3 流中读取 ID3 标签

发布于 2024-08-18 05:50:42 字数 325 浏览 5 评论 0原文

我正在使用 MediaPlayer 流式传输 mp3 文件

mp.setDataSource(myContext, Uri.parse("http://my_song.mp3"));  
mp.prepareAsync();  
mp.setOnPreparedListener(mpOnPreparedListener);  
mp.setOnBufferingUpdateListener(mpOnBufferingUpdateListener);  

您知道如何使用 android API 或任何替代方法从此流中读取 ID3 标签吗?

I'm streaming an mp3 file using MediaPlayer

mp.setDataSource(myContext, Uri.parse("http://my_song.mp3"));  
mp.prepareAsync();  
mp.setOnPreparedListener(mpOnPreparedListener);  
mp.setOnBufferingUpdateListener(mpOnBufferingUpdateListener);  

Any idea about how I can read the ID3 tags from this stream using android API or any alternative methods?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深巷少女 2024-08-25 05:50:42

您可以使用 MediaMetadataRetriever 获取所有这些,

MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(filePath);   

String albumName = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM);

您可以使用此类获取所有其他标签。
我希望这对你有帮助。

You can get all of this using MediaMetadataRetriever

MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(filePath);   

String albumName = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM);

you can get all other tags by using this class.
I hope this would help you.

心舞飞扬 2024-08-25 05:50:42

这是一个 opensouce 项目也许可以帮助你,http://www.jthink.net/jaudiotagger/index .jsp

Jaudiotagger 不是唯一可用的 Java 标记库,但确实具有一些您在评估要使用的库时可能需要考虑的关键优势

为所有完全支持的格式的最流行的 30 个属性提供通用接口
支持mp4、m4a和mp4p(受保护)文件的读写,包括多个图像和反向dns字段
支持多页 Ogg Vorbis 评论
透明支持 MP3 ID3v1、ID3v11、ID3v2.2、v2.3 和 v2.4
允许 ID3 标签版本之间轻松转换
支持 Flac,包括嵌入和链接图像支持
提供大多数字段的正确对象表示,而不是简单的字节表示
完全支持Unicode文本编码
正在积极开发和支持
使用自动测试套件来确保版本之间的代码兼容性
使用代码覆盖率工具确保代码确实经过测试
正在被许多应用程序使用

this is a opensouce project maybe can help you,http://www.jthink.net/jaudiotagger/index.jsp

Jaudiotagger is not the only Java tagging library available, but does have some key benefits you might like to consider in evaluating a library to use

Provide a generic interface for the most popular thirty attributes for all the fully supported formats
Supports reading and writing of mp4,m4a and mp4p (protected) files, including multiple images and reverse dns fields
Supports Multiple Page Ogg Vorbis Comments
Supports MP3 ID3v1,ID3v11, ID3v2.2, v2.3 and v2.4 are transparently
Allows easy conversion between ID3 tag versions
Supports Flac, including embedded and linked image support
Provides proper object representations of most fields, rather than a simple byte representation
Fully supports Unicode Text Encoding
Is being actively developed and supported
Uses an automatic testsuite to ensure code compatibility betweens versions
Uses a Code Coverage tool to ensure code is actually being tested
Is being used by a number of applications

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文