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.

+4 votes
Hello. I have a Unity scene that I allow the user to reset by reloading the same scene, using the following code...

SceneManager.LoadScene(SceneManager.GetActiveScene().name);

This should reset all the objects in the scene and start it from the beginning. The first time the scene is started, the WWise audio events work fine, but as soon as the scene is reset using the code above, the WWise audio events no longer work. Your thoughts?

I checked the Unity Editor logs and all the WWise-related entries look fine. Are there any other logs I can inspect to give me some kind of indication of what's wrong?

Thanks in advance for your help!
in General Discussion by Joe C. (140 points)

Also have this issue using Unity 5.5.2 with the latest Wwise integration. Would love to find a solution to this. Perhaps there is an alternate way to reset the scene?

Having the same issue myself.  Thought it could have been something to do with soundbanks not unloading/loading properly when the scene is restarted as I was getting an error saying that soundbanks couldn't be loaded as they were already loaded.  

I've tried creating a 'loading game screen' scene where the soundbanks will load on a DontDestroyOnLoad object, meaning they should only load once before the level loads and then persist. However, when restarting the scene I get no audio from those banks but no error messages either.  My UI audio in another soundbank (loaded in the same way but at the very first scene) persists and works after the level scene is restarted.  Not sure what else to try.
I found a fix.
Error: that happens because the soundbanks are unloaded right after they are loaded.
Fix:
Go to the WwiseGlobal GameObject that was created on your scene (sometimes it is created on playmode, if so, copy this gameobject during the playmode and paste on edit mode)
You gonna have a script attached to this gameobject called Ak Bank.
Set: Load On > Start
Set: Unload On > Nothing

Before reseting your scene or opening a new one call StopAll on your script to stop all the sounds, if needed. Something like:

        AkSoundEngine.StopAll();
        SceneManager.LoadScene("YOURSCENE", LoadSceneMode.Single);

1 Answer

0 votes
any errors in console?
by Ratko F. (290 points)
...