AudiokineticのコミュニティQ&AはWwiseやStrataのコミュニティ内でユーザ同士が質問・回答をし合うことができるフォーラムです。Audiokineticテクニカルサポートチームからの回答をご希望の場合は、必ず サポートチケットページ をご利用ください。

0 支持

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.
Bob B. (130 ポイント) General Discussion

回答 2

0 支持
Has anyone found a solution for this?
Robert E. (550 ポイント)
0 支持

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.

Samuel L. (Audiokinetic) (23.5k ポイント)
What should I do if I want to deal with certain events specifically?
...