Question by
PatMacalister · Mar 03, 2016 at 01:14 PM ·
audiovolumeout
How do I store the current volume of an AudioMixer in a variable?
I tried:
using UnityEngine;
using System.Collections;
using UnityEngine.Audio;
public class GetVolumeScript : MonoBehaviour {
public AudioMixer audioMixer;
private float volume;
// Update is called once per frame
void Update () {
audioMixer.GetFloat ("MasterVolume", out volume);
Debug.Log (volume);
}
}
However, the output on the log is always 0. I'm guessing I'm using the out parameter incorrectly. Any help is appreciated :)
exposedparameter.png
(24.1 kB)
Comment
That stores the volume parameter of the attenuation effect, but not the volume level. Did you find a solution?