GLBasic forum

Main forum => GLBasic - en => Topic started by: Ozden79 on 2010-Feb-24

Title: Music loop small gap!
Post by: Ozden79 on 2010-Feb-24
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?

Thanks,

Ãâ€"zden
Title: Re: Music loop small gap!
Post by: Kitty Hello on 2010-Feb-24
hm. Even on the iPhone?
I might check if I can loop the music in a separate thread...
Title: Re: Music loop small gap!
Post by: Ozden79 on 2010-Feb-24
I didn't check on IPhone, yet and will let you know once I test it.
Title: Re: Music loop small gap!
Post by: Kuron on 2010-Feb-26
Does this happen if the music is in WAV format when you load and loop it?
Title: Re: Music loop small gap!
Post by: Hemlos on 2010-Feb-26
Thread linked: How to loop alot of sounds perfectly.
(http://www.glbasic.com/forum/index.php?topic=3917.msg28705#msg28705)
Title: Re: Music loop small gap!
Post by: Ozden79 on 2010-Feb-26
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.
Title: Re: Music loop small gap!
Post by: Ozden79 on 2010-Mar-18
Sorry for that long delay...

In IPhone, though a bit better, it still makes a slight gap and not a soft continuous play...
Title: Re: Music loop small gap!
Post by: KermEd on 2010-Mar-19
@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.

-Ed
Title: Re: Music loop small gap!
Post by: Ozden79 on 2010-Mar-19
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.

Thanks,

Ãâ€"zden
Title: Re: Music loop small gap!
Post by: KermEd on 2010-Mar-20
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.
Title: Re: Music loop small gap!
Post by: kaotiklabs on 2010-May-23
Any solution for this problem?

I have just tried looping with playmusic now on iPhone and the still problem persist.
any hint?