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.

Wwise Unity integration 2017.2.1.6524.980 - all SoundBanks keep are unloaded by AkSoundEngineController

+8 votes

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.

asked Feb 9, 2018 in General Discussion by Kimmo K. (400 points)
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 Answer

+1 vote
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!
answered Feb 10, 2018 by Martín I. (170 points)
...