What's the API call to bypass effect in the AudioMixer? Or a workaround?
Snapshots don't save bypass state, only parameter values. While this does give the impression that it works if you floor the volume of a group to -80db, it still stresses the CPU. To add to the problem, this doesn't allow stacking effects, only setting a group / effect to solo.
Answer by Matexyu · May 23, 2017 at 09:51 AM
@scihuman
As of the date of this post, there is no existing API.
Only a (still open) feature request:
Workaround
A (probably performance sub-optimal) workaround is to:
in the AudioMixer inspector click on the small gear icon on the effect
select the "Enable Wet Mixing" option (it acts like a toggle)
a new "Wet" parameter will appear in the chosen effect: right-click on it and choose: "Expose Parameter ..."
You can now rename the exposed parameter default name by accessing the right-top edge drop-down menu of the AudioMixer that contains the effect. You can later access this "Wet" parameter via script using AudioMixer.SetFloat.
Set Wet to max to have your effect enabled, or to minimum to just bypass it. I never remember if in SetFloat you should use 0 to 1 values, or -80 to 0 (dB) values.
For a video tutorial about Exposed AudioMixer parameters, see here.
Your answer
Follow this Question
Related Questions
Trouble with syncing 2D animationClip and AudioClip on Opening Animation 0 Answers
How to hear audio in an animation while previewing,How to hear audio while previewing animations 0 Answers
Help with script for Main Menu? 1 Answer
Very low FPS because of AudioManager 1 Answer
Audio event in an animation decrease its volume and stopped 0 Answers