- Home /
Question by
ionside · Feb 24, 2020 at 12:35 PM ·
audiosourcesnapshotmix
Adjust volume with slider, against AudioMixerSnapshot
I'm using AudioMixerSnapshots to adjust mixer groups volumes to transition between different scenes and pausing, etc.
It's all working well, but now I'm trying to implement a user setting to adjust the group volumes by UI sliders. I'm unsure how to set the value by the current snapshot level.
I currently have
public void MusicVolChanged(float sliderValue)
{
audioMixer.SetFloat("musicVolume", Mathf.Log(sliderValue) * 20);
Debug.Log(musicVolSlider.value);
}
Which works as expected; overrides the snapshot. But now I need to multiply it by the snapshot value and I'm really unsure how to go about doing this.
Perhaps I need another mixer group used as a mixed output?
Comment
Best Answer
Answer by ionside · Feb 25, 2020 at 04:51 AM
I've found the best option is to have child groups. The snapshot affecting the parent and the sliders affecting the child groups which are output to the audiolisteners.