Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Audio How to change Ambisonic Decoder Plugin from script

Discussion in 'Audio & Video' started by waffle_maker, Jun 18, 2020.

  1. waffle_maker

    waffle_maker

    Joined:
    Feb 1, 2015
    Posts:
    3
    Spatializer Plugin seems to be able to be changed as follows, but I could not find a method to set Ambisonic Decoder Plugin.

    AudioSettings.SetSpatializerPluginName("Resonance Audio");
     
  2. bajeo88

    bajeo88

    Joined:
    Jul 4, 2012
    Posts:
    64
    I am also interested if anyone knows how to set this value from script?
     
  3. salinkViscopic

    salinkViscopic

    Joined:
    Jan 3, 2018
    Posts:
    1
    If you only want to use it in an Editor script the following works (tried on unity 2019.4.22f1):

    Code (CSharp):
    1.      
    2. using UnityEditor;
    3.  
    4. ...
    5.  
    6. var audioManagerAsset = AssetDatabase.LoadMainAssetAtPath("ProjectSettings/AudioManager.asset");
    7.  
    8. var serializedObject = new SerializedObject(audioManagerAsset);
    9. serializedObject.Update();
    10.  
    11. var ambisonicDecoderProperty = serializedObject.FindProperty("m_AmbisonicDecoderPlugin");
    12. ambisonicDecoderProperty.stringValue = "NameOfYourAmbisonicDecoder";
    13. serializedObject.ApplyModifiedProperties();
    14.  
     
    Last edited: Apr 19, 2021
    unity_SCkgoOtbCuomUA likes this.