Language

AudioManager.SetSurroundFormatEnabled(Int32, Boolean) Method

Definition

Sets and persists a certain surround format as enabled or not.

[Android.Runtime.Register("setSurroundFormatEnabled", "(IZ)Z", "GetSetSurroundFormatEnabled_IZHandler", ApiSince=31)]
[Android.Runtime.RequiresPermission("android.permission.WRITE_SETTINGS")]
public virtual bool SetSurroundFormatEnabled(int audioFormat, bool enabled);
[<Android.Runtime.Register("setSurroundFormatEnabled", "(IZ)Z", "GetSetSurroundFormatEnabled_IZHandler", ApiSince=31)>]
[<Android.Runtime.RequiresPermission("android.permission.WRITE_SETTINGS")>]
abstract member SetSurroundFormatEnabled : int * bool -> bool
override this.SetSurroundFormatEnabled : int * bool -> bool

Parameters

audioFormat
Int32

Value is one of the following: AudioFormat.ENCODING_AC3 AudioFormat.ENCODING_E_AC3 AudioFormat.ENCODING_DTS AudioFormat.ENCODING_DTS_HD AudioFormat.ENCODING_AAC_LC AudioFormat.ENCODING_DOLBY_TRUEHD AudioFormat.ENCODING_AC4 AudioFormat.ENCODING_AC4_L4 AudioFormat.ENCODING_E_AC3_JOC AudioFormat.ENCODING_DOLBY_MAT AudioFormat.ENCODING_MPEGH_BL_L3 AudioFormat.ENCODING_MPEGH_BL_L4 AudioFormat.ENCODING_MPEGH_LC_L3 AudioFormat.ENCODING_MPEGH_LC_L4 AudioFormat.ENCODING_DTS_UHD_P1 AudioFormat.ENCODING_DRA AudioFormat.ENCODING_DTS_HD_MA AudioFormat.ENCODING_DTS_UHD_P2

enabled
Boolean

the required surround format state, true for enabled, false for disabled

Returns

true if successful, otherwise false

Attributes

Remarks

Sets and persists a certain surround format as enabled or not.

This API is called by TvSettings surround sound menu when user enables or disables a surround sound format. This setting is persisted as global user setting. Applications should revert their changes to surround sound settings unless they intend to modify the global user settings across all apps. The framework does not auto-revert an application's settings after a lifecycle event. Audio focus is not required to apply these settings.

Java documentation for android.media.AudioManager.setSurroundFormatEnabled(int, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to