Hey guys,

I’ve recently upgraded from version 4.8.9 to 4.18.8, and now I get the following problem:

I use FMOD for organizing sound samples in time. Each sample has a start and an end time. Using sync points and callback, i sequence the samples in time. If a sound sample’s length is longer than the actual sample playtime, i set a sync point in the sound sample at the position where i want the sample to stop playing. Since i can’t call channel->stop(), i use channel->setPosition(length-1, FMOD_TIMEUNIT_MS) (where length is the length of sounds sample, NOT the actual play time). Thus, on the next system->update(), i get a FMOD_CHANNEL_CALLBACKTYPE_END, release the sound and continue with my life.

On 4.8.9 it used to work perfectly. On 4.18.8 I get a weird behavior – the sample isn’t played at all. Including the part of the sample that precedes the sync point where i call setPosition().

FMOD::Sound *sound;
unsigned int length;
sound->getLength(&length, FMOD_TIMEUNIT_MS);
channel->setPosition(length-1, FMOD_TIMEUNIT_MS);

I am not sure whether this is a bug at all. I know that this setPosition() is a bit of a crooked solution. Any advice on whether this is a bug or poor programming on my side?


  • You must to post comments

I’ve done some more debugging and i came up with something interesting.

I add the sync point in the following way:

[code:3r4ndgov]sound->addSyncPoint((int)durationOffset, FMOD_TIMEUNIT_MS, key.c_str(), &syncPoint);[/code:3r4ndgov]

where durationOffset is the time value where i want to stop the playing of the sample.

When I catch the sync point event i check for the sync point offset and channel position

unsigned int length;
cppchannel->getPosition(&length, FMOD_TIMEUNIT_MS);
sound->getSyncPoint(commanddata1, &sync);
unsigned int offset;
char syncPointName[MAX_LEN];
sound->getSyncPointInfo(sync, syncPointName, MAX_LEN, &offset, FMOD_TIMEUNIT_MS);

And what i get is that the sync point offset is as expected but the channel position is 0 (zero). Meaning it does go through the sound sample, but doesn’t play the channel.

Any idea?

  • You must to post comments

just to be sure have you checked any return values to see if any errors are being returned?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.