menu
 

在 Audiokinetic 社区问答论坛上,用户可对 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.
分类:General Discussion | 用户: Bob B. (130 分)

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.6k 分)
What should I do if I want to deal with certain events specifically?
...