0
0

I’m writing code right now to fire off a syncpoint callback with a sound on a regular basis, for example, every 500 ms.

To do this, I load the sound stream, and then iterate over it and do Sound::addSyncPoint() with offsets every 500 milliseconds until the length provided by Sound::getLength(). I then play the sound, and do Channel::setCallback() with a type of FMOD_CALLBACKTYPE_SYNCPOINT.

This works beautifully, except for the fact that it’s missing some of the callbacks. Every time the callback fires, I get the Sound from the Channel, get the SyncPoint from the index, and then do a Sound::getSyncPointInfo() on it, retreiving the time offset of the callback. I then print out the time to our debug console. So I can tell that it’s missing one just by watching the messages go by, but it’s verified by checking the numbers. Usually it’ll go up by 500, but every once in a while I’ll see a skip of 1000.

After having observed it for a few minutes, it seems that most often the syncpoint that it misses is the one toward the very end of the file (syncpoint is at 7500 ms, file length is 7520 ms), though sometimes it also misses one somewhere in the middle.

The sound that I’m using has the following flags passed into System::createSound():
FMOD_DEFAULT | FMOD_LOOP_NORMAL | FMOD_2D | FMOD_SOFTWARE | FMOD_CREATESTREAM | FMOD_UNIQUE | FMOD_OPENMEMORY
(yeah, the FMOD_DEFAULT is redundant)

It’s a 16-bit 48KHz stereo wave file with no compression.

We are calling System::update() every 1/20 of a second (50 milliseconds). The system was initialized with 512 software channels, 512 virtual channels, and the following flags to System::init()
FMOD_INIT_NORMAL | FMOD_INIT_DSOUND_DEFERRED | FMOD_INIT_DSOUND_HRTFFULL

Output is DirectSound – I’m using the internal sound card on my laptop (SigmaTel C-major).

So, is there something that I can do to ensure that all of the syncpoints fire? Is this a bug? Thanks!

  • Guy

PS – also I just realized that the syncpoint at millisecond 0 isn’t firing ever. Maybe it’s related?

  • You must to post comments
0
0

I encountered this issue earlier. If you have a track that loops, sync points near the end or beginning won’t fire unless you absolutely nail them with your System::update() – something to do with how brett calculates sync points.

I think he said he’d look into fixing it, though.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.