问题
I'm trying to play mp3-files using the JLayer Class Player. After starting the Thread containing
myPlayer.play()
you can hear some hundred milliseconds of the beginning of the song and then the player interrupts and I get the following error messages:
> javazoom.jl.decoder.BitstreamException: Bitstream errorcode 102 at
> javazoom.jl.decoder.Bitstream.newBitstreamException(Unknown Source)
> at javazoom.jl.decoder.Bitstream.readFrame(Unknown Source) at
> javazoom.jl.player.Player.decodeFrame(Unknown Source) at
> javazoom.jl.player.Player.play(Unknown Source) at
> javazoom.jl.player.Player.play(Unknown Source) at
> controller.PlayController.run(PlayController.java:51) at
> java.lang.Thread.run(Thread.java:724)
I've searched the internet for solutions and I've read that this error could occur due to problems with certain .mp3-files, but .wav- or .wma-files weren't either accepted. Does anyone know how I can get the player working? Thanks in advance
回答1:
I've gotten some distortion using Javazoom on Linux. a comment above about interrupting the input stream prompted me to keep the Player class instantiated and close the buffered input stream before opening every time, That seemed to help, but I'm not sure. It came back but less often and now goes away if I close Firefox.
Thanks for the insight about the input streams getting interrupted.
来源:https://stackoverflow.com/questions/20150953/problems-using-javazooms-player