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.

+1 vote
Is there any way to programmatically add an effect, such as Wwise Time Stretch, without having to regenerate the sound bank? We have a released game and regenerating all of the sound banks to add that effect is more or less out of the question because of the patch size it would create.

I was hoping that something like SetBusEffect or SetActorMixerEffect might be a solution, but I have not been able to get it to work. Does anyone have some sample code showcasing how I might use that functionality?

Any thoughts or advice would be most appreciated.

Thanks!
in General Discussion by Mark Z. (220 points)

3 Answers

0 votes

AK::SoundEngine::SetActorMixerEffect and AK::SoundEngine::SetBusEffect are what you want - if they are not working consider the comments for those function and see if they apply to your case in particular the following.

/// \aknote The option "Override Parent" in 
/// the Effect section in Wwise must be enabled for this node, otherwise the parent's effect will 
/// still be the one in use and the call to SetActorMixerEffect will have no impact.

> Any thoughts or advice would be most appreciated.

Releasing a game without a plan for patching it is irresponsible at best.

by Dan M. (2.6k points)
That is not the case, the objects I am trying to apply to are the parents in this case already.

From looking into it further, it appears that this effect cannot be applied to a bus, at least it will not let me do that in wwise proper. I have tried to use SetActorMixerEffect but apparently cannot figure out what the input for audioNodeID is supposed to be, as everything I have tried seems to be an invalid node.

As for your responsibility comment, we released a game and then had a thought for a potential new game mode and are now exploring if that's even something we want to or can do. So, thanks?

https://twitter.com/BekahHW/status/1181858806470529024
ctrl+right mouse click on the element in the amh tree and select "copy short id to clipboard"
it was actually shift + left click for anyone coming in the future, but yes, that was the ticket. Was trying GetIDFromString because I wasn't sure how to actually get the short id if it wasn't in the header file - so thanks for the help.
+1 vote
Regarding "patch sizes".  If you have a correction to make to an object (not the media), like adding an effect in your case, you can make a NEW bank with only the modified object in it (no media, no event, removed in the SoundBank Editor).  The bank will be tiny. Deploy that bank and make sure to load the new bank before the old banks.   Tadam! The new version of the object will take precedence over the old.  That said, you do need code in your game to be able to find and load said new bank.  Check the DLC articles in the documentation.

You will not be able to use the Time Stretch on a bus, even if you set it programatically.  There is a reason why the UI doesn't allow it :)  Conceptually, the sound sources push the sound to the bus for mixing, and then the effects of the bus are applied.  The TimeStretch effect changes the time referential.  So, if you accelerate time, your input will still be pushed at the same rate but the output would be shorter: you now have an audio gap every frame.  Conversely, if you slow time, the Time Stretch will make the output longer, which still needs to be mixed with other busses that are not time stretched.  Therefore, it would mix the appropriate number of samples with respect to the output sample rate, and a remainder would need to be carried over to the next audio frame.  Each second of playback, you'd accumulate a growing backlog of unplayed audio...  Soon enough you won't have enough memory.  On ordinary sounds, you don't have this issue because the source is definitively finite in time.
by Mathieu J. (Audiokinetic) (7.1k points)
Ah - that makes sense on the patch part. I am not actually the person who setup everything in wwise and I am still getting a feel for how it all works. So thanks for that info.

And thanks for taking the time on the additional info on the time stretch vs bus.
+1 vote
 
Best answer

Solved the problem with help from Dan M. pointing me in the right direction. I was trying to get GetIDFromString to get the ActorMixer id because I did not know how to otherwise get that info. Shift + right clicking the item in the hierarchy and selecting "Copy ShortID(s) to Clipboard" will let you find the appropriate id to use with SetActorMixerEffect. Wish that option wasn't hidden in a "secret" (to me at least) menu. 

by Mark Z. (220 points)
selected by Mark Z.
...