This site requires JavaScript, please enable it in your browser!
Greenfoot back
SPower
SPower wrote ...

2012/7/19

Exception with sound file

SPower SPower

2012/7/19

#
Hi all, I was working on a new game, when I got this exception: Exception in thread "SoundStream:file:/E:/Gebruikers/Sven/Programmeren/Greenfoot/Wolfenstein/sounds/backgroundSongs/backgroundSong1.MP3" java.lang.ArrayIndexOutOfBoundsException: 580 at javazoom.jl.decoder.LayerIIIDecoder.huffman_decode(LayerIIIDecoder.java:795) at javazoom.jl.decoder.LayerIIIDecoder.decode(LayerIIIDecoder.java:278) at javazoom.jl.decoder.LayerIIIDecoder.decodeFrame(LayerIIIDecoder.java:219) at javazoom.jl.decoder.Decoder.decodeFrame(Decoder.java:147) at greenfoot.sound.Mp3AudioInputStream.read(Mp3AudioInputStream.java:230) at greenfoot.sound.SoundStream.run(SoundStream.java:302) at java.lang.Thread.run(Thread.java:662) Exception in thread "SoundStream:file:/E:/Gebruikers/Sven/Programmeren/Greenfoot/Wolfenstein/sounds/backgroundSongs/backgroundSong1.MP3" java.lang.ArrayIndexOutOfBoundsException: 580 at javazoom.jl.decoder.LayerIIIDecoder.huffman_decode(LayerIIIDecoder.java:795) at javazoom.jl.decoder.LayerIIIDecoder.decode(LayerIIIDecoder.java:278) at javazoom.jl.decoder.LayerIIIDecoder.decodeFrame(LayerIIIDecoder.java:219) at javazoom.jl.decoder.Decoder.decodeFrame(Decoder.java:147) at greenfoot.sound.Mp3AudioInputStream.read(Mp3AudioInputStream.java:230) at greenfoot.sound.SoundStream.run(SoundStream.java:302) at java.lang.Thread.run(Thread.java:662) I'm not sure if I did something wrong with my sound file, or it's something else. Can somebody tell me?
danpost danpost

2012/7/19

#
You may have some extraneous tags in the file that Greenfoot does not like (especially, if you are using playloop). Remove all the information tags from the sound file using a music editor and try again.
mjrb4 mjrb4

2012/7/20

#
I've seen this issue before, I believe it's a bug in the JLayer mp3 library Greenfoot uses rather than with Greenfoot itself, and to that end there's not an awful lot we can do about it. It's possible the tags could be causing it - I re-encoded the tracks into mp3 using audacity / lame and in my particular case that seemed to solve it.
SPower SPower

2012/7/20

#
Thanks, I'll look at it.
You need to login to post a reply.