Contents

setMode(_:)

Sets the audio session’s mode.

Declaration

func setMode(_ mode: AVAudioSession.Mode) throws

Parameters

  • mode:

    The audio session mode to apply to the audio session. See Mode Swift.struct for supported mode values.

Discussion

The audio session’s category and 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.

See Also

Configuring standard audio behaviors