Version: 2020.3
音频性能分析器
音频剪辑

Ambisonic Audio

Ambisonics are a type of audio that provide a representation of sound that can completely surround a listener. They can provide an audio skybox for distant ambient sounds, and are particularly useful for 360-degree videos and applications.

Ambisonics are stored in a multi-channel format. Instead of mapping each channel to a specific speaker, ambisonics represent the soundfield in a more general way. You can rotate the soundfield based on the listener’s orientation (such as the user’s head rotation in VR). You can also decode the soundfield into a format that matches the speaker setup.

Selecting an ambisonic audio decoder

To select an ambisonic audio decoder in your project, open your project’s Audio settings (menu: Edit > Project Settings > Audio). Select an Ambisonic Decoder Plugin from the list of available decoders in the project. There are no built-in decoders included with Unity, but some VR hardware manufacturers provide them in their audio SDKs for Unity. Check your target platform manufacturer’s documentation to learn if this is available for your project.

音频设置中的立体混响声选项
音频设置中的立体混响声选项

Importing an ambisonic audio clip

To import an ambisonic audio clip, import a multi-channel B-format WAV file with ACN component ordering, and SN3D normalization. In the Inspector window for the audio clip, enable Ambisonic.

The Ambisonic option in the audio clip inspector
The Ambisonic option in the audio clip inspector

Playing the ambisonic audio clip through an Audio Source

To play an ambisonic audio clip through an Audio Source:

  • Assign the WAV file as an Audio Clip on an Audio Source.
  • Disable the Spatialize option. When you play an ambisonic audio clip, it is automatically decoded through the project’s selected ambisonic audio decoder. The decoder converts the clip from ambisonic format to the project’s selected speaker format. It also already handles spatialization as a part of this decoding operation, based on the orientation of the audio source and audio listener.

When Unity plays an ambisonic audio clip, it decompresses the file, if necessary, then decodes it to convert it to the project’s selected speaker mode. It then applies the Audio Source’s effects.

Note: Reverb zones are disabled for ambisonic audio clips.

Audio plugin interface changes

For information on how to author a plugin, see the Unity User Manual pages on the Native Audio Plugin SDK and Audio Spatializer SDK. You should also download the Audio plugin SDK.

There are two changes to AudioPluginInterface.h for ambisonic audio decoders:

  • A new effect definition flag, UnityAudioEffectDefinitionFlags_IsAmbisonicDecoder.
  • A new data struct, UnityAudioAmbisonicData.

UnityAudioEffectDefinitionFlags_IsAmbisonicDecoder

During the plugin scanning phase, this flag notifies Unity that this effect is an ambisonic decoder. Unity then allows the decoder to display as an ambisonic decoder option in your Project settings for Audio.

definition.flags |= UnityAudioEffectDefinitionFlags_IsAmbisonicDecoder;

UnityAudioAmbisonicData struct

The UnityAudioAmbisonicData struct is similar to the UnityAudioSpatializerData struct that Unity passes into spatializers, but with the addition of an ambisonicOutChannels integer. For more information on the UnityAudioSpatializerData struct, see the Audio Spatializer SDK documentation on spatializer effect meta data.

For the UnityAudioAmbisonicData struct, the ambisonicOutChannels should be set to the DefaultSpeakerMode’s channel count. Ambisonic decoders run early in the audio pipeline in Unity, and ambisonicOutChannels tells the plugin how many of the output channels Unity needs to use.

If you play back a first order ambisonic audio clip which contains 4 channels, and your speaker mode is stereo (which has only 2 channels), an ambisonic decoder’s process callback passes in 4 for the in and out channel count. The ambisonicOutChannels field is set to 2. The plugin should output its spatialized data to the first 2 channels and zero out the other 2 channels.

The Unity ambisonic sources framework can support first order ambisonics. The plugin interface includes the information to support binaural stereo and quad output, but the plugin itself determines which outputs are supported. Initially, ambisonic decoder plugins support first order ambisonic sources and binaural stereo output. There is no support for second order ambisonics.

There is nothing in the framework that is specific to any of the different ambisonic formats available. If the clip’s format matches the ambisonic decoder plugin’s expected format, then ambisonic audio should work without issue. Unity’s preferred ambisonic format is B-format, with ACN component ordering, and SN3D normalization.


  • 2017–08–10 页面已发布
  • Unity 2017.1 中的新功能 NewIn20171
音频性能分析器
音频剪辑