AudioSettings.speakerMode 扬声器模式

static var speakerMode : AudioSpeakerMode

Description描述

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

设置或获取当前扬声器的模式。默认为2声道立体声。

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.

请注意,音频系统是引导程序,当一个新的扬声器模式设置,这意味着所有正播放的音频源被停止。如果扬声器模式设置超出了驱动程序功能,则音频的行为是未定义的。使用AudioSettings.driverCaps获取当前驱动程序的功能。

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