Event execution order (stop command vs stream play)

Studio contains event A (play sound) event B (global stop command → stop all A sounds). If we trigger events B and A in the same frame, we are left with silence. Fmod logs are inconclusive about this…

Flow:

  • Game log: both start requests and the stop request were sent.
  • FMOD log: stream loading occurred.
  • FMOD log: no direct instance-state result.

Is this intended behavior? If I inject flushCommands in between, it works as expected.

Hi,

Yes that is the expected behavior. As FMOD Studio works in asynchronously (FMOD Engine | Studio Api Threads - Studio Thread Overview) the events are created at the same time, then they are updated at the same time. As the Stop command is for all existing instances of event A it is stopped.

Adding the FlushCommand()(FMOD Engine | Studio Api System - Studio::System::Flushcommands) will force the Stop command to happen before event A is created so it is allowed to play out:

Without FlushCommand()

With

Hope this helps.

Yeah, makes sense, batching at works :slight_smile: