由脚本控制全局音频设置。
设置扬声器输出和格式。
driverCapabilities | 返回当前音频驱动程序的扬声器模式功能。(只读) |
dspTime | 返回音频系统的当前时间。 |
outputSampleRate | 获取混合器的当前输出率。 |
speakerMode | 获取当前的扬声器模式。默认为 2 声道立体声。 |
GetConfiguration | 返回音频设备和系统的当前配置。然后,可以修改结构中的值并通过 AudioSettings.Reset 重新应用。 |
GetDSPBufferSize | 获取混合器的缓冲区大小,以样本数为单位。 |
GetSpatializerPluginName | 返回在当前运行的平台上选择的空间音响的名称。 |
GetSpatializerPluginNames | 返回一个数组,其中包含所有可用的空间音响插件的名称。 |
Reset | Performs a change of the device configuration. In response to this the AudioSettings.OnAudioConfigurationChanged delegate is invoked with the argument deviceWasChanged=false. It cannot be guaranteed that the exact settings specified can be used, but an attempt is made to use the closest match supported by the system. |
SetSpatializerPluginName | 为所有平台组设置空间音响插件。如果传入 null 或空字符串,则清除现有的空间音响插件。 |
OnAudioConfigurationChanged | 每当全局音频设置更改时调用的委托。全局音频设置更改可能由以下原因导致:AudioSettings.Reset 或外部因素更改(例如在系统控制面板中更改了采样率),或默认输出设备发生改变(例如,插入 HDMI 显示器或 USB 头戴式耳机时)。 |
AudioConfigurationChangeHandler | 每当全局音频设置更改时调用的委托。全局音频设置更改可能由以下原因导致:AudioSettings.Reset 或外部设备更改(例如在系统控制面板中更改了采样率),或默认输出设备发生改变(例如,插入 HDMI 显示器或 USB 头戴式耳机时)。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.