Contents

setActive(_:withFlags:)

Activates or deactivates your app’s audio session; provides flags for use by other audio sessions.

Declaration

func setActive(_ active: Bool, withFlags flags: Int) throws

Parameters

  • active:

    Use True to activate your app’s audio session or False to deactivate it.

  • flags:

    A bitmapped value containing one or more flags.

Discussion

If another app’s active audio session has higher priority than your app, and that other audio session doesn’t allow mixing with other apps, attempting to activate your audio session might fail.