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.

Need helploading scene specific soundbanks, playing Wwise audio from script, stopping that audio when scene is changed.

0 votes

My audio for a scene just ends up auto playing on start due to the AkBank component on the gameObject. When I disable and try and initiate it from code, it doesn't have access to the soundbank which has the event...? How am I supposed to have access to the soundbank without it autoplaying the audio connected to it?

 

I also just can't seem to play the audio just from my script. I can't cache the playingID to use to stop the audio playing as well (due to my very poor understanding of programming). Any help would be greatly appreciated. Thanks!

At the bottom of this post is a pic of my inspector

Here is my code.

GameManager Script (Handles Game states and connects Wwise event with Koreographer Music Visor):

https://gist.github.com/antonionii/5d765e91c8d9320bb0b9e164be8b9827

 

I was using this video as a guide (as I'm also trying to implement Koreographer)

https://www.youtube.com/watch?v=NxPvSn8y7cA

I'm also getting these errors:

WwiseUnity: Could not post event (name: Play_MainMenuMusic, ID: 667425441). Please make sure to load or rebuild the appropriate SoundBank.
UnityEngine.Debug:LogError (object)
AK.Wwise.Event:VerifyPlayingID (uint) (at Assets/Wwise/API/Runtime/WwiseTypes/WwiseTypes/AkWwiseEvent.cs:33)
AK.Wwise.Event:Post (UnityEngine.GameObject) (at Assets/Wwise/API/Runtime/WwiseTypes/WwiseTypes/AkWwiseEvent.cs:59)
Core.GameManager:_HandleMainMenu () (at Assets/Scripts/Core/GameManager.cs:110)
Core.GameManager:UpdateGameState (Core.GameState) (at Assets/Scripts/Core/GameManager.cs:88)
Core.GameManager:Awake () (at Assets/Scripts/Core/GameManager.cs:63)
Wwise: Event ID not found: 667425441 (GameObject: MainMenuManagers (UnityEngine.GameObject)) (Instance ID: 98222)
UnityEngine.Debug:LogError (object)
AkCallbackManager:PostCallbacks () (at Assets/Wwise/API/Runtime/Handwritten/Common/AkCallbackManager.cs:315)
AkSoundEngineController:LateUpdate () (at Assets/Wwise/MonoBehaviour/Runtime/AkSoundEngineController.cs:63)
AkInitializer:LateUpdate () (at Assets/Wwise/MonoBehaviour/Runtime/AkInitializer.cs:10

 

asked Mar 14, 2023 in General Discussion by Anthony B. (110 points)

Please sign-in or register to answer this question.

...