FMODWait releases after calling stop, causing warning

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lgarczyn
Posts: 30
Joined: Fri May 05, 2023 5:28 am

FMODWait releases after calling stop, causing warning

Post 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.
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMODWait releases after calling stop, causing warning

Post 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.
Post Reply