Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Resolved When trying to build standalone with AudioSettings, it fails to build

Discussion in '2022.1 Beta' started by jjejj87, Jan 27, 2022.

  1. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    On 2022b3, if one of the scripts have SetSpatializerPluginName API used, it fails to build. It works fine in editor just fails to build. fix.png
    Can we fix this asap? I really need to use this API.

    Thanks
     
  2. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Also why is there no API to disable Unity audio at runtime?
     
  3. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  5. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    hmmm...so we can't change spatializers at runtime?
     
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    To change your Spatializer Plugin in the build you could try this script:
    Code (CSharp):
    1. var audioManager = AssetDatabase.LoadMainAssetAtPath("ProjectSettings/AudioManager.asset");
    2. var serObj = new SerializedObject(audioManager);
    3. serObj.Update();
    4. var spatializerProperty = serObj.FindProperty("m_SpatializerPlugin");
    5. Debug.Log(spatializerProperty.stringValue);
    6. spatializerProperty.stringValue = "MS HRTF Spatializer";
    7. serObj.ApplyModifiedProperties();
     
  7. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Thanks!
     
    LeonhardP likes this.
  8. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Those are very much not runtime APIs!
     
  9. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Yeah...I ended up not using the spatializer at all. And had to write a custom pseudo spatializer built upon Unity Audio. I do wonder how VR games do spatializing...and if that can used on nonVR games