Page 1 of 1

FMODWait releases after calling stop, causing warning

Posted: Fri Nov 24, 2023 6:54 pm
by lgarczyn
I just discovered just how powerful FMODWait is, but only after spending a good 3 hours trying to implement the same thing.

So small nitpick, it would be nice to make it clearer that:

param 1 is a FMOD sample OR a Unity streaming asset path

param 2 is a programmer instrument

But on the real issue, in `SequencerCommandFMODWait.OnDestroy` the event is released/stopped in the wrong order.

protected virtual void OnDestroy()
{
if (state != PLAYBACK_STATE.STOPPED)
{
if (IsVoicePlaying()) eventInstance.stop(STOP_MODE.IMMEDIATE);
eventInstance.release();
}
}


As this link mentions:

https://qa.fmod.com/t/stop-immediate-th ... ty/16738/2

Release should happen before "stop", or fmod studio will emit this warning:

[FMOD] EventInstance::flushReleaseQueue : Event instance has programmer sounds pending release, update thread will be blocked until programmer sounds are released.

Re: FMODWait releases after calling stop, causing warning

Posted: Fri Nov 24, 2023 9:09 pm
by Tony Li
Thank you! I wasn't aware of that note. I've made the change for DS version 2.2.42, and I'll also update the manual page.