Music loop small gap!

Previous topic - Next topic


Hello There,

I loop a 30-40 seconds of music in my game and I see a small, like half a second, of gap exactly when the music finishes and starts again. I think this occurs while the music play engine rewinds back to the music start to replay it. What I want to ask whether this is something that can be fixed or should I make the arrangement in musics so they always have a gap in their end so this delay is not noticable?



Kitty Hello

hm. Even on the iPhone?
I might check if I can loop the music in a separate thread...


I didn't check on IPhone, yet and will let you know once I test it.


Does this happen if the music is in WAV format when you load and loop it?


Bing ChatGpt is pretty smart :O


Sorry that I still didn't test it on IPhone. This happens when I use PLAYMUSIC, as I use mp3 files as music.

I'll again post the results on IPhone when I test it.


Sorry for that long delay...

In IPhone, though a bit better, it still makes a slight gap and not a soft continuous play...


@Ozden79 > I used to work as an audio engineer.  Most people don't know this but standardized MP3 compression tools and libraries these days almost always add a tiny delay to the start of a song. 

I first noticed this when I was developing using MP3 Codec.  If you an audio-tool with loop capabilities (CoolEdit for example) you'll notice the gap exists in the audio software as well.

If possible I would replace it with a small looping .WAV file to see if its specifically the .MP3 format that causes the issue.



Hello Ed,

Thanks for the point, I did a quick test on PC with the "wav" and it still is the same. I think it's more related with how music files are played and probably buffering is not done on looping position, between end and start. I can live as it's now but it would be perfect if this would be working as expected.




Hi Ozden,

Yeah that sounds like its the compiler for sure then IMO.  It was worth a shot - I think your right about the buffering it makes sense.


Any solution for this problem?

I have just tried looping with playmusic now on iPhone and the still problem persist.
any hint?
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!