I'm trying to manipulate ID3 tags in MP3 Files using Java ID3 Tag Library. However, when i try to do ANYTHING using an "MP3File" class, i'm getting IOException: Negative Seek Offset;
Here's an example code and the stacktrace:
package com.test;
import java.io.File;
import java.io.IOException;
import org.farng.mp3.MP3File;
import org.farng.mp3.TagException;
public class MP3Test {
public static void main(String[] args) throws IOException, TagException {
File f = new File("test.mp3");
MP3File mp = new MP3File(f);
System.out.println(mp.getFrequency());
}
}
--------------------------------------------------------------------------------
Exception in thread "main" java.io.IOException: Negative seek offset
at java.io.RandomAccessFile.seek(Native Method)
at org.farng.mp3.id3.ID3v1.seek(Unknown Source)
at org.farng.mp3.id3.ID3v1.read(Unknown Source)
at org.farng.mp3.id3.ID3v1.<init>(Unknown Source)
at org.farng.mp3.MP3File.<init>(Unknown Source)
at org.farng.mp3.MP3File.<init>(Unknown Source)
at com.test.MP3Test.main(MP3Test.java:15)
As you see, even an basic operation throws me an exception, making it really hard for me to really develop something... The MP3 file that i'm trying to read is working perfectly fine. So, any ideas on why is this happening and/or how to solve it??