Sahil
Sahil

Reputation: 59

What is the use of other modes in AVAudioSession, when default mode is compatible for all categories?

// Access the shared, singleton audio session instance
let session = AVAudioSession.sharedInstance()
do {
    // Configure the audio session for movie playback
    try session.setCategory(AVAudioSessionCategoryPlayback,
                            mode: AVAudioSessionModeMoviePlayback,
                            options: [])
} catch let error as NSError {
    print("Failed to set the audio session category and mode: \(error.localizedDescription)")
}

Unable to understand the use of modes in audio sessions.

modes here

Upvotes: 0

Views: 2133

Answers (1)

Rob Napier
Rob Napier

Reputation: 299545

The other modes are optimized for specific usages. "Compatible" is not the same as "best." For example, when using the video chat mode:

the device’s tonal equalization is optimized for voice and the set of allowable audio routes is reduced to only those appropriate for video chat.

Upvotes: 2

Related Questions