unity audio mixer exposed name does not exist on mobile

Unity version: 2022.3.5f1

I am using sliders to change audio levels of subgroups of audiomixer. This was working fine in the editor and windows builds but I recently realized that this does not work on mobile. I have a logcat output like this:
2023.09.09 12:35:08.159 16293 16331 Warn Unity Exposed name does not exist: SFX (UnityEngine.AudioMixerGroup)

And the screenshot of my exposed parameter:
Ekran-g-r-nt-s-2023-09-09-123813 hosted at ImgBB — ImgBB

Here is the code i am using for setting volume.

  static AudioManager s_AudioManager;

    static AudioUtility()
    {
        s_AudioManager = GameObject.FindObjectOfType<AudioManager>();
    }

    public enum AudioGroups
    {
        Master,
        Music,
        Ambient,
        SFX,
        UI
    }
    public static AudioMixerGroup GetAudioGroup(AudioGroups group)
    {
        if(s_AudioManager == null) s_AudioManager = GameObject.FindObjectOfType<AudioManager>();

        var groups = s_AudioManager.FindMatchingGroups(group.ToString());

        if (groups.Length > 0)
            return groups[0];

        Debug.LogWarning("Didn't find audio group for " + group.ToString());
        return null;
    }

    public static void SetVolume(AudioGroups audioGroup, float value)
    {
        if (s_AudioManager == null) s_AudioManager = GameObject.FindObjectOfType<AudioManager>();
        AudioMixerGroup group = GetAudioGroup(audioGroup);

        float clampedVal = Mathf.InverseLerp(100, 0, value);
        clampedVal *= -80f;

        s_AudioManager.SetFloat(group.ToString(), clampedVal);
    }

And this is Setfloat function in the s_AudioManager

  public void SetFloat(string name, float value)
    {
        for (int i = 0; i < AudioMixers.Length; i++)
        {
            if (AudioMixers[i] != null)
            {
                AudioMixers[i].SetFloat(name, value);
            }
        }
    }

And there is only one AudioMixer in the project.

When I searched the internet i have came across with a guy had the same issue but he was using addressable where I don’t. So the problem is not related to that.

I also need to mention when i do this for “Master” it works. So the problem is only related to subgroups.

I started to think that this is a bug. Is there anyone can help?

The first thing I would try is to log all the exposed parameters available to be sure that, for some reason, your “SFX” parameter is still there but with a different name.

int numParams = mixer.parameterCount;
AudioMixerParameterDescription[] paramDesc = mixer.GetParameterDescriptions();

for (int i = 0; i < numParams; i++)
{
    Debug.Log("Parameter Name: " + paramDesc[i].name + ", Type: " + paramDesc[i].type);
}

Code you posted is not for unity but unreal engine if i am not mistaken. Also i don’t think unity supports getting exposed paramters via script. Correct me if i am wrong though

No sorry you’re absolutely right, there is something like this you can do but only with internal code. Apologies for the confusion…

This honestly looks like a bug in fact… I’m not aware of per-platform configuration you can make on the Mixer, unless you’re doing them through scripts.

Could you submit a bug report? This can be done directly from the Editor.

Thanks. I have issued a bug report as you said. Hoping it will be fixed soon.

1 Like

Well unity decided it was not a bug. The explanation points out that if you use AuidoMixerGroup.ToString() it includes the namespace as well. But this is the case for only android (haven’t tested ios). So instead of using that name property of the audio mixer group fixed the issue.
Related bug report:
Unity Issue Tracker - [Android] Warning message “Exposed name does not exist: SFX (UnityEngine.AudioMixerGroup)“ when changing volume with audiomixer.setfloat() (unity3d.com)

1 Like