社区问答

欢迎来到 Audiokinetic 社区问答论坛。在此,Wwise 和 Strata 用户可互帮互助。如需我们团队直接提供协助,请前往技术支持申请单页面。若要报告问题,请在 Audiokinetic Launcher 中选择“报告错误”选项(注意,问答论坛并不会接收错误报告)。我们内部设有专门的错误报告系统,会有专人查看报告并设法解决问题。

要想尽快得到满意的解答,请在提问时注意以下几点:

  • 描述尽量具体:比如,想达到什么样的目的,或者具体哪里有问题。
  • 包含关键细节:比如,Wwise 和游戏引擎版本以及所用操作系统等等。
  • 阐明所做努力:阐明自己为了排除故障都采取了哪些措施。
  • 聚焦问题本身:聚焦于问题本身的相关技术细节,以便别人可以快速找到解决方案。

+8 投票

Wwise Unity integration 2017.2.1.6524.980

Unity 2017.3.0p4, both Windows and Mac Editors

We have some SoundBanks we'd like to load once and keep loaded. In Unity we implement this by having a Prefab named PersistingSoundBanks with the AkBanks with we want to keep loaded, and a GameInitialization script in every Scene that loads this Prefab once, marks the Instantiated PersistingSoundBanks as DontDestroyOnLoad and sets a static boolean that this once-only loading has been done and won't reoccur when changing Scenes.

- The Prefab named PersistingSoundBanks has AkBank with "Load On: Awake" and "Unload on: Nothing".

- PersistingSoundBanks is ensured to be loaded only once by GameInitialization manager object that exists in every Scene, but checks if the load-once has been done already.

- After we load a new Scene with "UnityEngine.SceneManager.LoadSceneAsync(sceneName)" and the new Scene activates, any Event to Play sounds that is associated with a sound bank we now trust to be loaded and persisting as such will crash with errors like "Could not post event ID "1377943714". Did you make sure to load the appropriate SoundBank?"

I think this is because WwiseGlobal object is automatically added to every Scene and has AkInitializer Component on it, that executes AkSoundEngineController.Init where it seems it will do the following every time AkInitializer.Awake runs, essentially for every Scene load:

   AkSoundEngine.ClearBanks();
   AkBankManager.Reset();

If I understand correctly, AkInitializer is sabotaging our strategy of trying to keep SoundBanks persistently loaded which seems counter to SoundBank loading strategies manual would suggest to do in some cases.

 

So is this a bug in AkInitializer that ruins persisting SoundBanks by reinitializing at every Scene load?

Or is this a user error and should we not be using the Wwise default setting that adds the AkInitializer to every Scene, as AkInitializer/AkSoundEngineController is not supposed to support anything beyond a single demo/audio test room Scene without Scene transitions?

Our entire multi-Scene game is currently rigged with workarounds to load all SoundBanks again and again; any feedback, help, tips, affirmations and/or suggestions are welcome.

分类:General Discussion | 用户: Kimmo K. (400 分)
Hi, I think we are dealing with same problem (my topic: https://www.audiokinetic.com/qa/4302/unity-clear-banks-request-received) someone suggested me how to fix it but I haven't figured it out yet.

1个回答

+1 投票
I'm having the exact same problem!
I have an AkBank component attached to a gameobject that only exists once in the entire game (with DontDestroyOnLoad and a singleton pattern) with Load On: Awake and Unload On: Nothing.

You're really precisely describing my problem here. I hope someone answers!
用户: Martín I. (170 分)
...