Sets the audio session’s category, mode, and options.
- iOS 10.0+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
The category to apply to the audio session. See
AVAudiofor supported category values.
The audio session mode to apply to the audio session. For a list of values, see
A mask of additional options for handling audio. For a list of constants, see
Session Category Options
On input, a pointer to an error object. If an error occurs, the pointer is an
NSErrorobject that describes the error. If you don’t want error information, pass in
YES if the audio session category and options were set successfully; otherwise
The audio session’s
mode together define how your app uses 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 doing so results in an immediate change.