I want to loop a sound without gaps in android. I tried to use the code mediaplayer.setLooping(true)
to loop the sound, but there is always a little pause when the first sound is over and the next sound start.
spool. play(soundID, volume, volume, 1, 0, 1f); the number 0 represents the number you want to repeat the song. For infinite loop the suitable value is -1.
Try using the .ogg file format for the sound files in your application. I had this same issue, and after a lot of research , i tried the .ogg format and it loops without any gaps in android.
Info about .ogg format: http://en.wikipedia.org/wiki/.ogg
You can easily convert your sound file from .mp3 or what have you, to .ogg using the popular open source app VLC Media Player.
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