从java中的MP3标头中提取JPG数据的最简单方法是什么?

问题描述:

我编写了一个JSP,它将我的Flash前端传递给描述我的mp3文件夹内容的XML文件,但我仍然试图解析嵌入其中的专辑封面的各个文件头。任何人都可以推荐一个好的库,它有一些直接的东西,在伪代码看起来像......

I wrote a JSP that hands my Flash front-end an XML file that describes the contents of my mp3 folder, but am stuck trying to parse the individual file headers for the album art that is embedded therein. Can anyone recommend a good library that has something straight forward that in pseudo code would look like...

String mp3FilePath = "/mp3s/foo.mp3";
File myJpg = getImageFromMP3(mp3FilePath);

我不必使用JSP,如果这是一个问题,我可以编写一个servlet。

I don't have to use JSP, if that's a problem, I can write a servlet.

JAudioTagger 可能是最完整的解决方案。它支持许多版本的id3。但它太重了。如果您只需要图片,Jid3tag可能会更好。

JAudioTagger is probably the most complete solution. It's supports many versions of id3. But it's too heavy. Jid3tag may be better if you only need the picture.