用于流式传输 mp3 文件的 ID3v2 库?

发布于 2024-10-10 11:28:59 字数 121 浏览 0 评论 0原文

嘿,谁能指导我使用最简单的 java mp3 库来读取 ID3v2 标签。

更新 1:

我忘了提及,我需要在搜索栏上流式传输 mp3,因此需要一个 mp3 库,它可以通过下载最少的内容来读取长度。

Hey,can anyone guide me to the easiest java mp3 library for reading ID3v2 tags.

Update 1:

I forgot to mention that I need to stream the mp3 on a seek bar and therefore need a mp3 library which can read length by downloading minimum content.

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

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

发布评论

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

评论(2

冷了相思 2024-10-17 11:28:59

我过去使用过 mp3agic

够简单吗?

Mp3File mp3file = new Mp3File("SomeMp3File.mp3");
System.out.println("Length of this mp3 in seconds is: " + mp3file.getLengthInSeconds());
if(mp3file.hasId3v2Tag()) {
   ID3v2 id3v2tag = mp3file.getId3v2Tag();
   System.out.println("The artist in the ID3v2 tag is: " + id3v2tag.getArtist());

   id3v2tag.setArtist("A new artist");
   mp3file.save("ASavedMp3File.mp3");
   System.out("Saved mp3 file with new name and artist set to 'A new artist'");
}

I've used mp3agic in the past.

Simple enough?

Mp3File mp3file = new Mp3File("SomeMp3File.mp3");
System.out.println("Length of this mp3 in seconds is: " + mp3file.getLengthInSeconds());
if(mp3file.hasId3v2Tag()) {
   ID3v2 id3v2tag = mp3file.getId3v2Tag();
   System.out.println("The artist in the ID3v2 tag is: " + id3v2tag.getArtist());

   id3v2tag.setArtist("A new artist");
   mp3file.save("ASavedMp3File.mp3");
   System.out("Saved mp3 file with new name and artist set to 'A new artist'");
}
当爱已成负担 2024-10-17 11:28:59

我在我的在线 mp3 播放器项目中使用了 JAudioTagger java 库。它为 MP3 ID3v1、ID3v1.1、ID3v2.2、v2.3 和 v2.4 提供出色的支持。

I have used JAudioTagger java library for my online mp3 player project. It provides excellent support for MP3 ID3v1, ID3v1.1, ID3v2.2, v2.3 and v2.4.

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