Get Group Value
What it does: Returns the current value of the given exposed parameter for the complete AudioMixerGroup of the given sound and returns an AudioError (see Possible Errors), showing wheter and how getting the value of the given exposed parameter failed.
- DOES_NOT_EXIST
- MISSING_WRAPPER
- MISSING_SOURCE
- MISSING_CLIP
- MISSING_MIXER_GROUP
- MIXER_NOT_EXPOSED
How to call it:
- SoundNameis the- namewe have given the sound we want to get the- AudioMixerGroupparameter on
- ExposedParameterNameis the name we have given the exposed parameter on the- AudioMixer
- CurrentValueis the- variablethe current exposed parameter will be copied into- float.NaNon failure
string soundName = "SoundName";
string exposedParameterName = "Volume";
float currentValue = float.NaN;
AudioError error = am.GetGroupValue(soundName, exposedParameterName, out currentValue);
if (error != AudioError.OK) {
    Debug.Log("Getting AudioMixerGroup volume of the sound called: " + soundName + " failed with error id: " + error);
}
else {
    Debug.Log("Getting AudioMixerGroup exposed parameter with the name " + exposedParameterName + " on the sound called: " + soundName + " with the current value being: " + currentValue.ToString("0.00") + " succesfull");
}
When to use it: When you want to get an exposed parameter (for example the volume or pitch) for the complete AudioMixerGroup the sound is connected to.
Remarks: See AudioMixer.GetFloat for more details on what get group value does.