The speaker configurations that Unity supports.
Unity supports multiple speaker types. Each speaker type has a different number of channels and is suitable for different device types and situations. The operating system (OS) and hardware determine the final output. Unity requests a mode, but the system might override it. Always check the actual mode at runtime.
Note: AudioSpeakerMode configures the global audio output layout for the entire application. It doesn't assign an AudioSource to an individual speaker channel (for example, front left or rear right). To place sounds in the mix, use AudioSource.panStereo for left-right balance on mono or stereo clips, AudioSource.spatialBlend and the source position for 3D spatialization, AudioSource.spread for multichannel clips in speaker space.
The following are common uses for the speaker modes:
Use AudioSettings.GetConfiguration and AudioSettings.Reset to request a speaker mode at runtime. The device might not accept or support your requested speaker mode. In that case:
To set your project's default speaker mode, go to the Audio Manager: go to Edit > Project Settings > Audio and set Default Speaker Mode to your preferred speaker mode.
The following example demonstrates how to check the current speaker mode at runtime.
using UnityEngine;
public class SpeakerModeExample : MonoBehaviour { void Start() { Debug.Log("Current Speaker Mode: " + AudioSettings.GetConfiguration().speakerMode); } }
Additional resources: AudioSettings, AudioSource.panStereo, AudioSource.spatialBlend, AudioSource.spread, AudioMixer, Audio Manager.
| Property | Description |
|---|---|
| Mono | The speakers are mono and contain one channel. |
| Stereo | The speakers are stereo and contain two channels. |
| Quad | The Quad 4.0 speaker setup which contains four channels. |
| Surround | The Surround 5.0 speaker setup which contains five channels. |
| Mode5point1 | The Surround 5.1 speaker setup which contains six channels. |
| Mode7point1 | The Surround 7.1 speaker setup which contains eight channels. |
| Prologic | Stereo output, but data is encoded in a way that is picked up by a Pro Logic or Pro Logic 2 decoder and split into a 5.1 speaker setup. |