Search Unity

Question Which is better for controlling volume

Discussion in 'Audio & Video' started by Lyraedan, Apr 30, 2021.

  1. Lyraedan

    Lyraedan

    Joined:
    Jun 25, 2019
    Posts:
    8
    So simple question. Not trying to do anything too fancy I'm curious
    I have this equation.
    volume = (masterVolume * maxVolumeForAudioSource) / 1f;

    So lets say I have a master volume slider and a slider for music the equation would be
    volume = (masterVolume * musicVolume) / 1f;

    if I then introduced a sfx slider that equation to utilize that would be
    volume = (masterVolume * sfxVolume) / 1f;

    right. and then I'd assign the audio source volume to that volume value right.
    audioSource.volume = volume

    But what about audio mixers? What if introduced those into the equation? Would that be overkill for simply adjusting volume? Which would be better for somebody who's never used AudioMixers?