In my game I have a menu an audio section and inside of that is a button to toggle audio on and off and a slider to adjust the level of the sound effects. Ideally I would like 100% on the slider to be at 0dB but I can’t wrap my head around how to script it. Any help please?
Edit: I’ve created a snapshot called SFXvol and a corresponding event to house it. Inside the snapshot it says I can automate the volume fader on the sfx channel but where do I go form here? I know how to connect the parameter to the slider in unity.
You could use a snapshot but adjusting the volume of the corresponding buses would be easier, especially when using the Unity GUI Sliders.
FMOD.Studio.Bus sfxBus;
Slider sfxSlider;
sfxBus = FMODUnity.RuntimeManager.GetBus(busName);
sfxBus.getFaderLevel/getVolume(out volume); // Depending on the version of FMOD
sxfSlider.value = volume;
Then you can setup functions for when the slider value changes.
void OnSFXValueChange()
{
volume = sfxSlider.value;
sfxBus.setFaderLever/setVolume(volume); // Depending on the version of FMOD
}
Thanks for the help.
This is probably one of those things that will seem super easy to me in the near future but i’m struggling a little to understand at the moment.
first off,
sfxBus = FMODUnity.RuntimeManager.GetBus(busName);
I’m guessing this section all goes inside the awake/start function and where it says ‘(busname)’ I’m not sure what to put. Is it literally like calling a parameter in fmod and writing what I’ve called my bus in single quote marks?