社区问答

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

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

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

+4 投票
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!
分类:General Discussion | 用户: Joe C. (140 分)

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个回答

0 投票
any errors in console?
用户: Ratko F. (290 分)
...