How add a short interval before play next time?


#1

Hi.
I want to add a short interval when a sound is playing at loop mode, is there an automatic method in low level api or should I implement it myself?
Thanks a lot!


#2

Im guessing you want to pause the sound before it loops each time, FMOD does not do that as a loop feature, but you can queue up sounds with sample precision and the setDelay function. You could call playsound/setdelay many times up front to queue a bunch of sounds.

There is an example already that does this - see gapless playback example.

Where it says

            clock_start += slen;                                        /* Place the sound clock start time to this value after the last one. */

This could just have the gap inserted with

        clock_start += gapsize_samples;                            /* Add a gap */