Play Ambisonic Audio in Unity
The Meta XR Audio supports playing AmbiX format ambisonic audio so you can attach 4-channel AmbiX format audio clips to GameOjects. Rotating either the headset (the AudioListener) or the audio source itself affects the ambisonic orientation.
Ambisonics are rendered by our advanced spherical harmonic binaural renderer. Compared to traditional rendering methods that use virtual speakers, this renderer provides a better frequency response, better externalization, less spatial smearing, and also uses less compute resources.
You can control the level of ambisonic audio sources in your scene by customizing the Volume Rolloff curve for each audio source.
By the end of this document, you’ll be able to:
- Setup your project to use Meta XR Audio as the Ambisonic Decoder Plugin.
- Setup an ambisonic audio source be processed by Meta XR Audio.
- Understand the behaviors of the Meta XR Audio ambisonic plugin.
To add ambisonic audio to a scene in Unity:
Ensure Meta XR Audio is selected as Ambisonic Decoder Plugin in Edit > Project Settings > Audio.
- Add the AmbiX format ambisonic audio file to your project by copying the audio file to your Unity assets.
- In the Project window, select your audio file asset.
In the Inspector window, check the Ambisonic check box and then click Apply.
- Create a GameObject to attach the sound to.
Add an Audio Source component to your GameObject and configure it for your ambisonic audio file. There should be a “speaker” icon on the GameObject.
- In the AudioClip field, select your ambisonic audio file.
Make sure Spatialize on the Audio Source component is not checked.
Note: if Spatialize is enabled the ambisonic sound will be downmixed to mono and processed as a point source!
In the Output field, select SpatializerMixer > Master.
Note that unlike point source sounds described in
the spatialization section, the Meta XR Audio Source script should not be added to the GameObject.
- Learn more about using Acoustic Ray Tracing to enhance the level of immersion for spatialized mono sources.