Search code examples
javaswingmp3ioexceptionjavasound

Error while playing some MP3s using JavaZOOM BasicPlayer classes


Here is the stack trace:

java.io.IOException: Resetting to invalid mark
    at java.io.BufferedInputStream.reset(BufferedInputStream.java:433)
    at org.tritonus.share.sampled.file.TAudioFileReader.getAudioInputStream(TAudioFileReader.java:324)
    at javazoom.spi.mpeg.sampled.file.MpegAudioFileReader.getAudioInputStream(Unknown Source)
    at javazoom.spi.mpeg.sampled.file.MpegAudioFileReader.getAudioInputStream(Unknown Source)
    at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1179)
    at javazoom.jlgui.basicplayer.BasicPlayer.initAudioInputStream(Unknown Source)
    at javazoom.jlgui.basicplayer.BasicPlayer.initAudioInputStream(Unknown Source)
    at javazoom.jlgui.basicplayer.BasicPlayer.open(Unknown Source)
    at BasicPlayerDemo.play(BasicPlayerDemo.java:49)
    at BasicPlayerDemo.main(BasicPlayerDemo.java:24)

Seems that other people are also having this problem:

Any reason for this? I am trying to make a simple Java Swing music player using JavaZoom classes.


Solution

  • There is a solution for this problem at (pelzkuh.de blog) It is in German but mainly says that the cause is an outdated library mp3spi1.9.4.jar. You have to replace it with the new one mp3spi1.9.5.jar. Links are provided in the pelzkuh blog entry.