Version: 2023.2
言語: 日本語

AudioSettings

class in UnityEngine

マニュアルに切り替える

説明

スクリプトからグローバルなオーディオ設定をします。

スピーカーの出力と形式をセットアップします。

Static 変数

driverCapabilitiesオーディオドライバのスピーカーのモードを返します(読み取り専用)
dspTimeオーディオシステムの現在時刻を返します。
outputSampleRateミキサーの現在の出力レートを取得します。
speakerMode AudioSettings.speakerMode is deprecated. Use AudioSettings.GetConfiguration and AudioSettings.Reset to adjust audio settings instead.

Static 関数

GetConfigurationオーディオデバイスとシステムの現在の設定を返します。これを使用すると、AudioSettings.Reset によって構造体内の値を修正・再適用することが可能になります。
GetDSPBufferSizeサンプル内でミキサーのバッファサイズを取得します。
GetSpatializerPluginNameReturns the name of the spatializer selected on the currently-running platform.
GetSpatializerPluginNamesReturns an array with the names of all the available spatializer plugins.
ResetChanges the device configuration and invokes the AudioSettings.OnAudioConfigurationChanged delegate with the argument deviceWasChanged=false. There's no guarantee that the exact settings specified are used, but Unity automatically uses the closest match that it supports. Note: This can cause main thread stalls if AudioSettings.Reset is called when objects are loading asynchronously.
SetSpatializerPluginNameSets the spatializer plugin for all platform groups. If a null or empty string is passed in, the existing spatializer plugin will be cleared.

Events

OnAudioConfigurationChangedグローバルオーディオ設定が変更されるたびに呼び出されるデリゲートです。設定は AudioSettings.Reset によって変更される場合と、外部の要因によって変更される場合(例えば OS のコントロールパネルでサンプルレートが変更された場合や、HDMI モニタ や USB ヘッドセットの接続時にデフォルトの出力デバイスが変更された場合など)があります。

デリゲート

AudioConfigurationChangeHandlerグローバルオーディオ設定が変更されるたびに呼び出されるデリゲートです。設定はAudioSettings.Reset によって変更される場合と、外部デバイスによって変更される場合(例えば OS のコントロールパネルでサンプルレートが変更された場合や、HDMI モニタ や USB ヘッドセットの接続時にデフォルトの出力デバイスが変更された場合など)があります。