当默认模式兼容所有类别时,AVAudioSession 中其他模式的用途是什么?
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)")
}
无法理解音频会话中模式的使用。
modes here
其他模式针对特定用途进行了优化。 "Compatible" 与 "best." 不同 例如,当使用 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.
// 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)")
}
无法理解音频会话中模式的使用。
modes here
其他模式针对特定用途进行了优化。 "Compatible" 与 "best." 不同 例如,当使用 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.