AudioSession.SetActive Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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