Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Why are calls to the AK::SoundEngine::Query namespace blocking?

0 votes
I am having performance issues with Queries in the SDK. Whenever I call a Query function, my game thread will stall for a few milliseconds. Is there something I can do?
asked May 6, 2013 in General Discussion by Moderator (Audiokinetic) (490 points)
edited May 8, 2013 by Moderator (Audiokinetic)

1 Answer

+2 votes
 
Best answer
Most calls in the AK::SoundEngine::Query namespace acquire the global sound engine mutex, which can be held for several milliseconds by the sound engine thread. It is therefore recommended to register a AkGlobalCallbackFunc (using AK::SoundEngine::RegisterGlobalCallback) and do the Queries from there, as your function will then be called at each audio frame from inside the audio thread, already holding the mutex.
answered May 6, 2013 by Moderator (Audiokinetic) (490 points)
selected Jun 19, 2013 by Adrien L. (Audiokinetic)
...