Activates or deactivates your app’s audio session.
- iOS 3.0+
- tvOS 9.0+
- watchOS 2.0+
YESto activate your app’s audio session, or
NOto deactivate it.
On input, a pointer to an error object. If an error occurs, the pointer is set to an
NSErrorobject that describes the error. If you do not want error information, pass in
YES if the session’s active state was changed successfully, or
NO 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.