The Android XR Audio SDK provides high-quality spatial audio rendering and acoustic simulation for XR apps on Android XR. Powered by an updated Resonance Audio engine, this SDK lets you render realistic 3D soundscapes, simulate physical room acoustics based on scene geometry, and precompute high-fidelity reverb for complex environments.
Key features
The extension transforms audio from basic stereo panning to a fully-spatialized, immersive experience that responds dynamically to user movement:
Binaural 3D Spatializer: Renders a standard, mono
AudioSourcein 3D space with high-fidelity binaural rendering:- Audio source distance attenuation and directivity customization
- Audio source spread
- Occlusion masking
- Near-field effects
Ambisonic Decoder: Decodes and renders 3-Degrees-of-Freedom (3DOF) ambisonic soundfields to recreate complex, prerecorded acoustic environments.
Dynamic Room Effects: Simulates early reflections and late reverberation based on shoebox-shaped room boundaries and adjustable acoustic materials.
Acoustic Reverb Probes: Employs ray tracing to analyze complex visual geometries and bake realistic, performance-friendly reverb configurations directly into your scene.
Soundfield Recorder: Captures multiple active, spatialized real-time audio sources from your editor session and exports them directly into seamless, loopable ambisonic files.
Get started
Follow these steps to import the package and configure Unity's native audio engine to use the Android XR Audio pipelines.
1. Download and install the package
First, download and install the package:
Download the latest package by clicking the following button:
Open your Unity project.
Navigate to Window > Package Manager.
Click "+" in the top-left corner and select Add package from tarball....
Select the
com.google.xr.audio.spatializer.tgzfile in your local SDK directory.
2. Configure Unity project audio settings
To route Unity's audio pipeline through the spatializer:
- Go to Edit > Project Settings > Audio.
- From the Spatializer Plugin drop-down, select Android XR Audio.
- From the Ambisonic Decoder Plugin drop-down, select Android XR Audio.
3. Route output to the Dedicated Audio Mixer
The plugin requires a specialized mixer to render spatialized outputs:
Locate the pre-configured mixer asset at the following file location:
Packages/Android XR Audio/Resources/AndroidXRAudioMixer.mixerFor every active
AudioSourcein your scene that needs spatialization, assign its Output property to the Master group of thisAndroidXRAudioMixer.
Explore optional core components
Optional core components provide supplemental controls for customizing spatial audio behavior. They aren't strictly required, as the extension can use default parameter values for spatial audio rendering if these components aren't attached.
AndroidXRAudioListener
Extends Unity AudioListener with global spatial audio
settings and provides an in-editor soundfield recorder to pre-render spatial
sources into ambisonic audio files.
Must coexist on the same GameObject as your active Unity
AudioListener (typically your Main Camera or XR Rig).
- Global Gain (dB): Fine-tunes the master output level of all spatialized sources.
- Occlusion Mask: Defines the layer mask used for physical raycast checks to calculate sound obstruction.
- Enable Stereo Speaker Mode: Forces standard stereo panning. Keep this disabled for headphone-based binaural XR rendering; enable only when outputting to physical, external loudspeakers.
AndroidXRAudioSource
Extends any spatialized Unity AudioSource with additional parameters for
spatial audio sources.
- Bypass Room Effects: When checked, the source ignores reflections from local rooms or baked reverb probes.
- Directivity (Alpha & Sharpness): Shapes the emission pattern of the sound (e.g., creating a highly focused directional cone versus an omnidirectional source).
- Near Field Effect: Boosts low frequencies when a spatialized source passes extremely close to the listener's head.
- Quality Level: Adjusts rendering overhead from basic Stereo, to Low, up to CPU-intensive High Binaural.
AndroidXRAudioRoom
Defines a customizable "shoebox" volume to simulate realistic, real-time early reflections and reverberation.
- Surface Material Selection: Map unique materials (such as concrete, glass, plaster, or acoustic tile) to each of the six room boundaries.
- Reflectivity: Scales the strength of the initial bounce reflections.
- Reverb Settings: Provides direct modifiers for late-stage reverb gain, overall decay time, and high-frequency brightness.
Try advanced editor tools
Try out the advanced editor tools in this section for specialized use cases.
Reverb baking
For non-shoebox rooms or complex, organic geometry, use the CPU ray tracer to precompute highly accurate reverb parameters. Follow these steps to set it up:
Acoustic Material Mapping:
- Go to Assets > Create > Android XR Audio > Material Map.
- Create an asset that pairs your project's visual Unity Materials with physical acoustic behaviors.
- Assign the acoustic materials to corresponding Unity Materials in your scene.
Open the Baking Window: Navigate to Android XR Audio > Reverb Baking and assign your newly-created Material Map.
Place Probes: Place
AndroidXRAudioReverbProbesinto your scene where the user is likely to travel and set their bounding influence zones (like a Box or Sphere).Bake:
- Configure your occlusion layer masks.
- Toggle Visualize Mode to verify material assignments in the scene view.
- Click Bake.
The ray-traced acoustic properties write directly into the probes' runtime parameters. Use the Gain, Brightness, and Time parameters on individual Reverb Probes to fine-tune reverb behavior.
Download Android XR Audio SDK for Unity
Before downloading, you must agree to the following terms and conditions.