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 not reacting to Switches even though they appear in capture log?

+1 vote
Hi there, I having quite a lot of trouble with Switches at the moment. I'm finding that my switch continers are not reacting to the changes of switches when playing in game.

I have varifeid all my events are set correctly. When I am not connected, I can simulate all the switch changes in a soundcaster session and all my events react as expected. However, when I connect to the game playing in editor, I can see all the switch changes correctly fireing in the caputure log but the profiler clearly shows that the events are only playing the default switch sound sfx. When I remove the defualt setting from the switch container and regenerate, the events don't play in game or appear in voice graph when connected, though they work fine in the soundcaster as before when unconnected.

I don't know if these are futher clues but; my switch containers are parenting random containers which don't appear in the profiler when connected. In the voice graph I see the correct event, which links to the correct switch container (the object referenced in the event) which links to the sfx played, but misses out the random container in the hirachy. Is this normal behavior for the profilier? The other thing is that when i'm connected and viewing the soundcaster session, I can see the states change appropirotly in tandem with the capture log, but the switches do not change, even though the capture log shows them doing so.

If you know what's going or or where the problem might be, i'd be really greatful if you could point me in the right direction.

asked Feb 9, 2016 in General Discussion by Dan M. (230 points)
edited Feb 9, 2016 by Dan M.

1 Answer

+1 vote
Best answer
Hi Dan,

Are you sure that the switch changes are being sent to the same AkObject as the sound events? The scope of a switch is only within a singular game object (AkObject). Hope this helps.
answered Feb 11, 2016 by Richard Goulet (5,740 points)
selected Feb 16, 2016 by Benoit S. (Audiokinetic)
Brilliant! Yep that solves it. I had assumed they acted like states and were a universal change. Weird they didn't mention that in the 'using switches' documentation :s

Could you please expand on that answer a bit more please? I think I'm having the same issue but I don't understand what you mean when you say "sent to the same AkObject".

I have a switch in Wwise, to which a Playlist container is connected. I expect that if any object changes the switch, the playlist will react accordingly. What does it mean that "the scope of a switch is within a singular game object"?
So all Wwise audio and audio logic plays on an AkGameObject in the game editor (Unity, Unreal etc.) Every sound plays through a component on an object in the game - which tells Wwise where it is playing. Wwise keeps a log of these; it targets sound to whatever your AkEvent plays on. It will generate an AkGameObject at run time if you haven't already got one.

Switches and RTPCs are AkGameObject specific. They will only affect the sounds and events that are playing on the same AkGameObject they are targeted to. Meaning you could have loads of different objects all using the same switch but working independantly.
Oh, I see. Thank you, I had not quite understood that every sound was being played through the object that called the event. It makes sense now.

I guess that means I should never use a Switch for something that is inherently global like music. A State would probably be more intuitive to manage.
Hi Dan, I can understand your answer but, in unreal I really don't know how to target the same AkObject because the Set State blueprint didn't have a pin to enter an Actor into it.