Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

AudioSpeakerMode

enumeration

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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.

The following are common uses for the speaker modes:

  • Stereo is the standard default for most applications.
  • Use Mono for accessibility reasons.
  • Use 5.1 or 7.1 for high-end PC and console setups, home televisions, theaters.
  • Use Quad and 5.0 for specific installations.
  • Only use Pro Logic if you must support matrix decoding.

Use AudioSettings.speakerMode to request the device to use a specific speaker mode. The device might not accept or support your requested speaker mode. In that case:

  • On some platforms, Unity automatically reduces the audio channel count (downmixes) to one your device supports.
  • On other platforms, Unity runs the device's native channel count.

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.speakerMode); } }

Additional resources: AudioSettings, Audio Manager.

Properties

Property Description
MonoThe speakers are mono and contain one channel.
StereoThe speakers are stereo and contain two channels.
QuadThe Quad 4.0 speaker setup which contains four channels.
SurroundThe Surround 5.0 speaker setup which contains five channels.
Mode5point1The Surround 5.1 speaker setup which contains six channels.
Mode7point1The Surround 7.1 speaker setup which contains eight channels.
PrologicStereo 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.