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
Hi,

I want to fluctuate the value of MaxDistance for certain AttenuationCurves depending on the game situation.
However, in the current state of Wwise, MaxDistance cannot be controlled by RTPC.
Is there any way to vary the MaxDistance of specific AttenuationCurves from the program side?
Or, if there is another way, I would like to know about it.
in General Discussion by ヒロシ (110 points)
In Unity I managed to do this using AkSoundEngine.SetScalingFactor(gameObject, float). To call this function I had to register the gameObject first and because I do this it doesn't automatically create an AkGameObj component during runtime. This is what I call on Awake to scale the distance with my GameObject transform scale:
        gameObject.AddComponent<AkGameObj>();
        AkSoundEngine.RegisterGameObj(gameObject);
        AkSoundEngine.SetScalingFactor(gameObject, transform.lossyScale.x);

https://www.audiokinetic.com/en/library/edge/?source=SDK&id=ak_soundengine_registergameobj.html

https://www.audiokinetic.com/en/library/edge/?source=SDK&id=ak_soundengine_setscalingfactor.html

1 Answer

0 votes
A work around would be to have a switch with your different situations for a given sound and have a different attenuation for each blend/situations under that switch (Same sound, different attenuations). This workflow does not scale well though...

Would be nice indeed to be able to vary the attenuations with an RTPC!
by Nikola Viel (1.6k points)
I am looking to do something similar - there is a node in Unreal "Set Attenuation Scaling Factor" - but it seems this will apply to all sounds playing on that AK Component.

In my case, I would like to use a switch (or RTPC) to select a specific attenuator when triggering a sound. Would save me a lot of trouble if I could do this on whole categories of sounds.... because yeah, duplicating thousands of sounds into switch containers would be a lot of busywork to manage.
...