Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes

When our Unity-powered game loses window focus, Wwise suspends the sound engine, and no sound is heard. But when the window regains focus, we get a spamming of all of the sound events that were posted while the game was still running in the background.

  • Is there a way to tell Wwise not to suspend when focus is lost?
  • Or, a way to ignore posted events that occur when the focus is lost?
Thanks.
in General Discussion by Bob B. (130 points)

2 Answers

0 votes
Has anyone found a solution for this?
by Robert E. (550 points)
0 votes

In general, this is something to be implemented in the game's code depending on the desired outcome when the application is in the background.
The relevant general documentation can be found here: https://www.audiokinetic.com/en/library/edge/?source=SDK&id=workingwithsdks_system_calls.html#system_calls_background

In this case, if the game is allowed to keep sending events to Wwise (its game loop still runs), AK::SoundEngine::Suspend(true) is the call that should be made to allow the processing of those events, while still muting the sound.
This is activated in the Unity integration through the "RenderDuringFocusLoss" platform setting.

Instead, if on focus loss the game loop is paused, then no events can be sent to Wwise and AK::SoundEngine::Suspend(false) should be called, so that all Wwise events processing is stopped. RenderDuringFocusLoss will achieve this outcome.

For reference, the Unity integration code responsible for this handling in is located in Assets/Wwise/MonoBehavior/Runtime/AkSoundEngineController.cs.

by Samuel L. (Audiokinetic) (23.6k points)
What should I do if I want to deal with certain events specifically?
...