Hello,
I'm trying to understand the behavior of Wwise when calling SoundEngine functions on a global callback on, say the AkGlobalCallbackLocation_Begin location, and I have a bunch of questions:
In my callback, if I call AK::SoundEngine::PostEvent(), will that Event trigger on that same update? The callback is in the event thread, so does the system know to enqueue it and process it immediately? I see that the callback includes an AK::IAkGlobalPluginContext pointer, which has a PostEventSync() function. Should I use that instead? Will there be any difference between them in this case?
What about other calls, such as SoundEngine::SetRTPCValue(), SoundEngine::SetSwitch(), or SoundEngine::SetState()? The global plugin context has an SetRTPCValue() function. Is that synchronous like PostEventSync()? Should I prefer calling that function from the global callback? There's no equivalent for SetSwitch() and SetState(), so what is the behavior there? Will the changes get processed in the current frame?
Similar question for GameObject-related functions: will AK::SoundEngine::SetPosition() work correctly when called from a global callback, and will it execute that same frame?
Are there any SoundEngine functions that I should avoid calling from a global callback?
Thank you!
(We're currently using Wwise 2024.1.)