Volume Issue with Custom Headset

In our iOS application, we have a custom headset without a microphone. We want users to listen through this headset while speaking via an ipad microphone. However, when we use the default route-changing code in Swift, the iOS system recognizes the iPad as a complete device and routes the audio output through the iPad’s speaker instead.

How can we improve this to ensure that audio input is correctly routed to the ipad microphone while allowing audio playback through our custom headset?

do {
let audioSession = AVAudioSession.sharedInstance()

        try audioSession.setCategory(AVAudioSession.Category.playAndRecord, options: [.allowBluetoothA2DP])
        try audioSession.setActive(true)
    }catch {
        print("Failed to set up audio session: \(error)")
    }

do {
let availableInputs = try audioSession.availableInputs
if let inputs = availableInputs {
for input in inputs {
if input.portType == .bluetoothHFP || input.portType == .headsetMic {
try audioSession.setPreferredInput(input)
break
}
}
}
} catch {
print(“Failed to configure audio routing: (error)”)
}


}

Hello Niki,

Unfortunately at this time neither Video SDK nor Meeting SDK for iOS supports routing across multiple audio or video devices, as the Zoom iOS client does not support this functionality.

Thank you for your patience,
Richard

I have solved this issue using twilio default engine .

/// Twilio Video Call Code
            let audioDevice = DefaultAudioDevice()
             self.audioDevice = audioDevice
             audioDevice.block = { [weak self] in
                 do {
                     DefaultAudioDevice.DefaultAVAudioSessionConfigurationBlock()
                     let audioSession = AVAudioSession.sharedInstance()
                    // try audioSession.setMode(.default)
                     try audioSession.setCategory(AVAudioSession.Category.playAndRecord, options: [.allowBluetoothA2DP])
                     try audioSession.setActive(true)

                 } catch let error as NSError {
                     AppDebug.printLog(value: "Error Setting Up Audio Session",level: .error)
                    ShowMessage.show(.error, "Error Setting Up Audio Session")
                 }
             }
            TwilioVideoSDK.audioDevice = audioDevice

SO , Is there way to achieve using the zoom sdk .