Hi Folks,
I'm currently working on video conferencing app and use AVRoutePickerView for output device selection. Since iOS 16 release it started to display incorrect names for ear-piece and speaker options. For both of them the name is iPhone
(before it was iPhone/Speaker) Output changes works correctly but display names confuse.
Here is my audio session configuration:
private func configureSession() {
let configuration = RTCAudioSessionConfiguration.webRTC()
configuration.category = AVAudioSession.Category.playAndRecord.rawValue
configuration.categoryOptions = [.allowBluetooth, .allowBluetoothA2DP, .duckOthers, .mixWithOthers]
let session = RTCAudioSession.sharedInstance()
session.lockForConfiguration()
do {
try session.setConfiguration(configuration)
} catch let error as NSError {
logError("[AudioSessionManager] Unable to configure RTCAudioSession with error: \(error.localizedDescription)")
}
session.unlockForConfiguration()
}
private func overrideOutputPortIfNeeded() {
DispatchQueue.main.async {
guard let currentOutputType = self.session.currentRoute.outputs.first?.portType else { return }
self.session.lockForConfiguration()
let shouldOverride = [.builtInReceiver, .builtInSpeaker].contains(currentOutputType)
logDebug("[AudioSessionManager] Should override output to speaker? \(shouldOverride)")
if shouldOverride {
do {
try self.session.overrideOutputAudioPort(.speaker)
} catch let error as NSError {
logError("[AudioSessionManager] Unable to override output to Speaker: \(error.localizedDescription)")
}
}
self.session.unlockForConfiguration()
}
}
Any help appreciated, Thansk!