Author Topic: Music loop small gap!  (Read 2432 times)

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Music loop small gap!
« 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

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10683
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Music loop small gap!
« Reply #1 on: 2010-Feb-24 »
hm. Even on the iPhone?
I might check if I can loop the music in a separate thread...

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Re: Music loop small gap!
« Reply #2 on: 2010-Feb-24 »
I didn't check on IPhone, yet and will let you know once I test it.

Offline Kuron

  • Mr. Polyvector
  • ***
  • Posts: 238
    • View Profile
Re: Music loop small gap!
« Reply #3 on: 2010-Feb-26 »
Does this happen if the music is in WAV format when you load and loop it?

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1622
  • Particle Hawk
    • View Profile
Re: Music loop small gap!
« Reply #4 on: 2010-Feb-26 »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Re: Music loop small gap!
« Reply #5 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.

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Re: Music loop small gap!
« Reply #6 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...

Offline KermEd

  • Mc. Print
  • *
  • Posts: 24
    • View Profile
Re: Music loop small gap!
« Reply #7 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

Offline Ozden79

  • Mr. Polyvector
  • ***
  • Posts: 121
    • View Profile
Re: Music loop small gap!
« Reply #8 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

Offline KermEd

  • Mc. Print
  • *
  • Posts: 24
    • View Profile
Re: Music loop small gap!
« Reply #9 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.

Offline kaotiklabs

  • Dr. Type
  • ****
  • Posts: 313
  • Spain is diferent
    • View Profile
Re: Music loop small gap!
« Reply #10 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?
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!