Bluetooth mic in, live listen out

Is it possible to link a HFBluetooth input device with the output iPhone speaker while Live Listen is active?

Answered by Engineer in 890463022

This is currently only possible using the Input Route Picker, or preferredInput API, potentially the multiRoute API for mutli-in, multi-out.

Although we have been expanding our input + output configurations for audio routing, we do not currently support HFP input + Speaker output during LiveListen. Please file a request to support this audio route through Apple's Feedback Assistant: https://developer.apple.com/feedback-assistant/

Good morning, thanks for the question. Looking into this now to see if it's currently possible...

Accepted Answer

This is currently only possible using the Input Route Picker, or preferredInput API, potentially the multiRoute API for mutli-in, multi-out.

Although we have been expanding our input + output configurations for audio routing, we do not currently support HFP input + Speaker output during LiveListen. Please file a request to support this audio route through Apple's Feedback Assistant: https://developer.apple.com/feedback-assistant/

Unfortunately not yet correct....when I tried

[session setCategory:AVAudioSessionCategoryMultiRoute mode:AVAudioSessionModeDefault options:options error:error]

I got back the value NO and an error:

Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"

For those reading these posts, "Accepted Answer" was marked on a response "No, can't do it.". Subsequently it was changed to "Yes, use AVAudioSessionCategoryMultiRoute" - to which I responded above. Now it is changed to "only possible using the Input Route Picker, or preferredInput API, potentially the multiRoute API for mutli-in, multi-out" which I can't parse.

I do know that AVRoutePickerView did not seem to work in my hands.

@PBK Can you let me know if you have any questions on our revised response? The original response was addressing the usage specifically for LiveListen but then a colleague mentioned we should let you know that we do support this configuration for non-LL routes.

Let me check with another colleague on the multiRoute usage issue you're seeing.

Hi @PBK , can you try using dualRoute mode with multiRoute category as a workaround?

https://developer.apple.com/documentation/avfaudio/avaudiosession/mode-swift.struct/dualroute?language=objc

[session setCategory:AVAudioSessionCategoryMultiRoute 
mode:AVAudioSessionModeDualRoute 
options:(AVAudioSessionCategoryOptionAllowBluetoothHFP) 
error:error]; // AllowBluetoothHFP is required here

This should give you 2 inputs / 2 outputs with built-in mic/spk as one route, and HFP route as the secondary route.

Here's a more in-depth guide on how to route each input/output audio to audio units

https://developer.apple.com/documentation/avfaudio/routing-audio-to-specific-devices-in-multidevice-sessions?language=objc

If dualRoute is an overkill, I haven't specifically tested this but you could try setting AVAudioSessionCategoryOptionBluetoothHighQualityRecording. This option requires allowBluetoothHFP option to be set and is only compatible with Default mode

One caveat is that it require hardwares that support this mode

Specifying this option enables full-bandwidth audio when the Bluetooth route supports it, such as on certain AirPods models.

Any chance we can continue this great dialogue after I try a few things?

@PBK of course! We're happy to help go through iterations. Is LiveListen a requirement or were you mostly interested in the loopback used for routing mic audio to output?

"@PBK of course! We're happy to help go through iterations." --- THANKS!!!

"Is LiveListen a requirement" --- no, I just want the audio ported to hearing aids. I was hoping that Live Listen would satisfy part of the task by switching hearing aids for iPhone speaker. I am able to use the USB-C port as audio input and play out through the hearing aids using LiveListen. But if I can identify the hearing aids as a BluetoothA2DP that's fine.

Bluetooth mic in, live listen out
 
 
Q