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

2014/2/26

Sound Bugs?

Pointifix Pointifix

2014/2/26

#
I am getting Console Errors after playing sounds over some time with playLoop(), but i dont know if this is my mistake or if this is a Greenfoot bug? The errors look like that: Exception in thread "SoundStream:file:/C:/Users/Simon/Desktop/Greenfoot%20Projekte/SimpleGame/Projekt%2015.02/Projekt%2015.02/sounds/backgroundhighscore.mp3" java.lang.ArrayIndexOutOfBoundsException: 580 or that: Exception in thread "SoundStream:file:/C:/Users/Simon/Desktop/Greenfoot%20Projekte/SimpleGame/Projekt%2015.02/Projekt%2015.02/sounds/backgroundhighscore.mp3" java.lang.ArrayIndexOutOfBoundsException: 2305 or this: Exception in thread "SoundStream:file:/C:/Users/Simon/Desktop/Greenfoot%20Projekte/SimpleGame/Projekt%2015.02/Projekt%2015.02/sounds/backgroundhighscore.mp3" java.lang.ArrayIndexOutOfBoundsException: 2304 Does anyone knows where they come from? Is there any way to fix that, if not, does this bugs also come up on greenfoot platform or just local at my computer?
danpost danpost

2014/2/26

#
Information tags in mp3 files can often produce these type of exceptions (the first one looks very similar to it). Try re-saving the file without the tags.
Pointifix Pointifix

2014/2/26

#
heh that can be, cause all sound those make bugs have a title and interpret infos ill try to change that, if it work i already say thanks ;)
Pointifix Pointifix

2014/2/26

#
tags/information of the mp3 files deleted, but still i got this one: Exception in thread "SoundStream:file:/C:/Users/Simon/Desktop/Greenfoot%20Projekte/SimpleGame/Projekt%2015.02/Projekt%2015.02/sounds/backgroundhighscore.mp3" java.lang.ArrayIndexOutOfBoundsException: 580
lordhershey lordhershey

2014/2/26

#
Do you get the message when the sound reaches the end of it's play? I have seen that and had to edit the sound to put a bit of dead air on the end and I stopped getting the index out or bounds error.
Pointifix Pointifix

2014/2/26

#
the error comes at the end of the sound yes, mhhmm but how to put silence at the end of a mp3 file, im not a music maker ;D
lordhershey lordhershey

2014/2/26

#
just download audacity (it is free), open the mp3, just add a tiny bit and save as an mp3. I am not sure how the greenfoot is handling the sound buffer, but I ran into this problem in another sound library I had been using and that library was using this trick to basically turn the sound buffer into an infinite length file stream (by sensing the end and automatically sending the file pointer back to position 0 - it was very slick) but on mp3s of a certain size it would not calculate the size of the initial buffer properly.
Pointifix Pointifix

2014/2/26

#
So, now i had to watch some Audacity Tutorials to understand how i can add some dead area at the end, but it seams working now, he does not make any console errors any more, thank you a lot lordhershey
You need to login to post a reply.