Search Unity

Audio Mixer not working on iOS?

Discussion in 'iOS and tvOS' started by andrew210, Jun 21, 2020.

  1. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    241
    Hello!

    This bit of code for turning on UI sounds (similar snippets exist for Music, which also doesn't work on iOS), does not appearing to be working on iOS, however it does work perfectly on Android, Windows, and in editor on the mac. Does anyone have any ideas / thoughts on what could be going wrong on iOS?

    Code (CSharp):
    1.    
    2. public bool uiSoundOn {
    3.         get {
    4.             return _soundOn;
    5.         }
    6.         set {
    7.             _soundOn = value;
    8.             float newAudio = Mathf.Log10(value ? 1f : -0.10f) * 20;
    9.             this.audioGroup.SetFloat("UIVolume", newAudio);
    10.             saveSettings();
    11.         }
    12.     }