I am using the sound interface in LibGdx to play mp3 audio files. And when choose to loop playing the sound more than one time using sound.loop();
it works but with small silent period of time every time the sound replayed. So Is there any ways to get rid of this silent period or to play sound effects more smoothly than the one I use?
here is my code:
Sound accelarating_sound1;
accelarating_sound1 = Gdx.audio.newSound(Gdx.files.internal("speedUp.mp3"));
accelarating_sound1.loop(1,f,0);
MP3 files have some decoding(?) delay at the start, using WAV files will give you larger filesizes but don't seem to have that delay.
Its weird that libgdx lets you set whether a track is looping, but doesn't buffer the start of the track when its almost finished.
My answer is a quick fix for small sound effects since I'm having the same problem too, except with a looping piece of music. Making it a WAV will take too much space.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With