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.

Pause resume all sounds on a game object

0 votes
We find ourselves needing a way of pausing and later resuming all sounds currently playing on an AkComponent so we can silence an object by deactivating it.

I was hoping there was a method in the API for doing this per game object, but it seems there isn't.  AkComponents don't keep a list of playing IDs so we can't pause all the sounds individually.  Even unregistering the game object doesn't stop the sounds (and even if that did work I suspect that they wouldn't start again when we re-registered it).

We could remove the listener, but that wouldn't actually pause the sounds, just mute them.

Have other people had this issue?  How did you deal with it?
asked Jun 21, 2022 in General Discussion by Sam B (220 points)

1 Answer

0 votes
If I understand you correctly, you need to set the scope in the event from "global" to "game object". This is done in Wwise, not in the engine. It will pause your sfx only on the game object that you post the event on. You can also set pause events for an Actor-Mixer and even busses, which will pause all sounds assigned to it.
answered Jun 24, 2022 by Lucas C. (540 points)
I'm afraid that's not quite what I meant.  I need to pause _all_ playing events on a game object, not a specific one.  And I don't know exactly _what_ events are playing on it, nor the playing IDs (as they are not stored in UAkComponent or anywhere else).

Doing it by mixer or bus isn't an option either, as there will be instances of the same event playing on other game objects that need to stay playing.

We have ExecuteActionOnEvent and ExecuteActionOnPlayingID.  What we need is ExecuteActionOnGameObject.  :)
As mentioned, the intended way is to create an event with event actions for pause/resume: you can use the Pause All and Resume All event actions for that purpose. Make sure the scope is Game Object (it's the default).
...