Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Change Spatializer Plugin by editor script

Discussion in 'Audio & Video' started by GuyTidhar, Nov 15, 2016.

  1. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Hi guys,

    Is it possible to change the Spatializer Plugin audio setting by an editor script?

    I can not seem to find such an option. I don't see why this shouldn't be possible in the editor while developing (not at runtime).

    Thanks!
     
  2. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Actually - for starters - even reading the current Spatializer Plugin does not seem to be possible. Have I missed something?
     
  3. sunxl_cs

    sunxl_cs

    Joined:
    Nov 24, 2016
    Posts:
    1
  4. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Being able to read it - is a must for sure.
     
  5. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
  6. carrotstien

    carrotstien

    Joined:
    Jun 8, 2016
    Posts:
    37
    still nothing :(
     
    GuyTidhar likes this.
  7. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    True...

    Unityguys - even just being able to read can help quite a bit to avoid mixups, and I don't see how this would be a big change for you.

    And I don't see why it shouldn't at least be available to be written in editor script.
     
  8. bgallaghermusic

    bgallaghermusic

    Joined:
    Oct 15, 2016
    Posts:
    1
  9. nomadic

    nomadic

    Joined:
    Mar 4, 2010
    Posts:
    44
    It took me a while to find the solution so...

    For those using Unity 2017.2 or later, you can use AudioSettings.GetSpatializerPluginName and AudioSettings.SetSpatializerPluginName.

    For those using an older version, you can load the AudioSettings asset:

    AssetDatabase.LoadMainAssetAtPath("ProjectSettings/AudioManager.asset")
    ...and edit the serialized property "m_SpatializerPlugin".
     
    freekpixels likes this.