Audio Timing + Seamless Looping?


#1

A couple questions…

First, to keep download size to a minimum, I recorded a small sound snippet of an engine running. This sounds fine in the audio editing software when set to loop - i.e. it’s continuous and seamless. However, in Studio, when looping by invoking restart() in the finish event handler, there is a very noticeable “stutter” each time the audio is restarted. Is there a way to get smooth, seamless looping?

Secondly, I have another audio track which simply counts to 10, and it should be synchronized (to the second) with a simple onscreen animation - i.e. basically, some text that’s updated each second. However, I can’t get the audio consistently and reliably sync’d to the animation? The audio starts late, as though it’s off by the time it takes to load. (It’s about 50KB in size.) Is there a way to “pre-load” the audio so that it’s ready to go when I need it to kick in?

I’m using OGG files, by the way. Would WAV be better?


#3

Just to follow up on this…

I scrapped the idea of looping the engine sound. It just didn’t work as I’d hoped. I needed only 10 seconds, so I just recorded the full 10s and downsampled the audio to 11 KHz (probably could get away with 6 KHz) to keep the file size down. (Don’t really need high fidelity for this sound - especially on a mobile device.)

As for the timing, the sound is started before it’s actually needed, but with the volume at zero. Then, when needed, the volume is set to the desired level and restart() is invoked.