Activates or deactivates your app’s audio session using the specified options.
- iOS 6.0+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
trueto activate your app’s audio session, or
falseto deactivate it.
An integer bit mask containing one or more constants from the
Session .Set Active Options
true if the session’s active state was changed successfully, or
false if it was not.
If another active audio session has higher priority than yours (for example, a phone call), and neither audio session allows mixing, attempting to activate your audio session fails. Deactivating an audio session that has running audio objects will stop the running audio objects, deactivate the session, and a
AVAudio error will be returned.