阅读filme mp3的信息

时间:2015-07-06 21:09:34

标签: java mp3

我正在尝试创建一个程序来读取特定文件夹中mp3文件(相册,艺术家等)的信息。 在互联网上搜索我找到了库Java ID3 Tag Library

我写了这个简单的类:

package main;

import java.io.File;
import java.io.IOException;

import org.farng.mp3.MP3File;
import org.farng.mp3.TagException;
import org.farng.mp3.id3.ID3v1;

public class Main {

  public static void main(String[] args) throws IOException, TagException {

    File sourceFile = new File("C:\\Users\\John\\Desktop\\Adele\\Tired.mp3");
    MP3File mp3file = new MP3File(sourceFile);
    ID3v1 tag = mp3file.getID3v1Tag();
    System.out.println(tag.getAlbum());
    System.out.println(tag.getAlbumTitle());
    System.out.println(tag.getTitle());

  }

}

当我跑步时,eclipse会产生这个错误:

Exception in thread "main" java.lang.UnsupportedOperationException
    at org.farng.mp3.id3.FrameBodyRVAD.setupObjectList(Unknown Source)
    at org.farng.mp3.AbstractMP3FragmentBody.<init>(Unknown Source)
    at org.farng.mp3.id3.AbstractID3v2FrameBody.<init>(Unknown Source)
    at org.farng.mp3.id3.FrameBodyRVAD.<init>(Unknown Source)
    at org.farng.mp3.id3.AbstractID3v2Frame.readBody(Unknown Source)
    at org.farng.mp3.id3.ID3v2_3Frame.read(Unknown Source)
    at org.farng.mp3.id3.ID3v2_3Frame.<init>(Unknown Source)
    at org.farng.mp3.id3.ID3v2_3.read(Unknown Source)
    at org.farng.mp3.id3.ID3v2_3.<init>(Unknown Source)
    at org.farng.mp3.MP3File.<init>(Unknown Source)
    at org.farng.mp3.MP3File.<init>(Unknown Source)
    at main.Main.main(Main.java:16)

我该如何解决? 谢谢!

PS:我在库中添加了jar文件。

0 个答案:

没有答案