AudioSettings.speakerMode 扬声器模式

static var speakerMode : AudioSpeakerMode


Sets or gets the current speaker mode. Default is 2 channel stereo.


Be aware that the audio system is bootstrapped, when a new speaker mode is set, meaning that all playing AudioSources are stopped. If a speaker mode is set beyond the drivers capability, the audio behaviour is undefined. Use AudioSettings.driverCaps to get the capabilities of the current driver.


using UnityEngine;

using System.Collections;

public class example : MonoBehaviour {

	public void Awake() {

		AudioSettings.speakerMode = AudioSettings.driverCaps;

// To set the speaker mode to that of the system settings.


AudioSettings.speakerMode = AudioSettings.driverCaps;
Page last updated: 2011-1-7