setCategory(_:)
Sets the audio session’s category.
Declaration
func setCategory(_ category: AVAudioSession.Category) throwsParameters
- category:
The category to apply to the audio session. See Category Swift.struct for supported category values.
Discussion
The audio session’s category defines how the app uses audio. Typically, you set the category before activating the session. You can also set the category while the session is active, but this results in an immediate route change.