Editar

Compartir a través de


AudioSession.SetActive Method

Definition

Overloads

SetActive(Boolean)

Enables or Disables the audio session.

SetActive(Boolean, AudioSessionActiveFlags)

Activates or deactivates the audio session.

SetActive(Boolean)

Enables or Disables the audio session.

[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.None, null)]
public static void SetActive (bool active);
static member SetActive : bool -> unit

Parameters

active
Boolean

Whether to enable the audio session.

Attributes

Remarks

This method is used to enable and disable the audio session.

This method can throw an AudioSessionException if another application is currently using the AudioSession in the foreground and does not support audio mixing.

Applies to

SetActive(Boolean, AudioSessionActiveFlags)

Activates or deactivates the audio session.

[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.None, null)]
public static AudioToolbox.AudioSessionErrors SetActive (bool active, AudioToolbox.AudioSessionActiveFlags flags);
static member SetActive : bool * AudioToolbox.AudioSessionActiveFlags -> AudioToolbox.AudioSessionErrors

Parameters

active
Boolean

True if you want to activate your audio session, false to disable it.

flags
AudioSessionActiveFlags

Optional flags used to notify other applications of the change, it can be used to allow other applications to resume playback.

Returns

Error code.

Attributes

Applies to