Instance Property


The current audio session mode.


var mode: AVAudioSession.Mode { get }


The audio session mode, together with the audio session category, indicates to the system how you intend to use audio in your app. You can use a mode to configure the audio system for specific use cases such as video recording, voice or video chat, or taking measurements.

Default value is default. The values available for this property are described in Audio Session Modes.

See Also

Configuring the Audio Session

var category: AVAudioSession.Category

The current audio session category.

func setCategory(AVAudioSession.Category)

Sets the current audio session category.

func setCategory(AVAudioSession.Category, options: AVAudioSession.CategoryOptions)

Sets the audio session category with the specified options.

var availableCategories: [AVAudioSession.Category]

The audio session categories available on the current device.

var categoryOptions: AVAudioSession.CategoryOptions

The mask of options associated with the current audio session category.

func setMode(AVAudioSession.Mode)

Sets the audio session mode.

var availableModes: [AVAudioSession.Mode]

The audio session modes available on the device.