使用Java读取远程MP3文件的ID3标签 [英] Reading Remote MP3 File's ID3 Tags using Java

查看:323
本文介绍了使用Java读取远程MP3文件的ID3标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种从远程服务器上的MP3文件中读取ID3标签而无需实际下载文件的方法。我见过像JAudioTagger和Entagged这样的库,但两者似乎都需要一个文件对象,而不是一个URL或InputStream,我知道如何使用远程文件。还有另一个库可以做到这一点吗?或者有没有办法让正确的对象使用URL与这些类进行交互?

I am looking for a way to read the ID3 tags from an MP3 file on a remote server without actually downloading the file. I have seen libraries like JAudioTagger and Entagged, but both seem to require a file object and not a URL or InputStream, which I know how to get with a remote file. Is there another library that can do this? Or is there a way to get the correct object to interact with these classes using a URL?

推荐答案

此页面介绍了如何获取ID3 V. 1个标记的MP3文件。 http://willcode4beer.com/parsing.jsp?set=mp3ID3

This page describes how to get the ID3 V. 1 tags of an MP3 file. http://willcode4beer.com/parsing.jsp?set=mp3ID3

它提供了..

public Tag readTag(InputStream in, long start) throws ..

..这是你想要远程URL的方法。一个基本的想法是获得URLConnection&查询MP3中数据的长度,然后从该数字中减去128。使用它作为起始参数(否则它将非常慢)。

..method that is what you will want for a remote URL. The basic idea would be to get an URLConnection & query it for the length of the data in the MP3, then subtract 128 from that number & use that as the start argument (otherwise it will be very slow).

这篇关于使用Java读取远程MP3文件的ID3标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆