Sets the audio session mode.
- iOS 5.0+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The audio session mode to apply to the audio session. See Audio Session Modes for supported mode values.
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 on success or
NO on failure.
The audio session's category and mode together define how your app intends to use audio. Typically, you set the category and mode before activating the session. You can also set the category or mode while the session is active, but this results in an immediate change.