Search Unity

Bug AudioMixer volume SetFloat on exposed parameter doesn't work when mixer inactive?

Discussion in 'Audio & Video' started by chino01, Oct 22, 2020.

  1. chino01

    chino01

    Joined:
    Jul 19, 2014
    Posts:
    13
    I just wanted to clarify if this is an expected behaviour or a bug? Using 2019.4.9f1:

    - In a common scenario, when loading settings from a file or from player prefs on load, and setting the mixer values on exposed parameters using SetFloat(string,val), if mixer is inactive SetFloat does not work.

    - After you play a sound on the mixer it gets active and you must then initialize the values?

    - In AudioMixer Auto Mixer Suspend is enabled /disabled does not affect that.
     
    curiosissimo likes this.
  2. curiosissimo

    curiosissimo

    Joined:
    Sep 28, 2017
    Posts:
    3
    I've been looking for this problem for ages. Now I know that it's a bug. Thanks!
     
  3. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Do you mean when setting from
    Awake
    ? If so, that's not a supported scenario - set the parameters in
    Start
    or
    Update
    instead.
     
  4. curiosissimo

    curiosissimo

    Joined:
    Sep 28, 2017
    Posts:
    3
    I'm setting it in Start. If Auto Mixer Suspend is set to true, volume changes aren't detected immediately. Let's say I turn down the volume with my slider. Sometimes I can still hear the sound for 1 second even if AudioMixer shows -80db.
     
  5. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Ok, that's something different, then - can you post a small project that demonstrates the issue?
     
  6. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    253
    Please add this to documentation