How to set iOS app to use usb audio for input and output to internal speakers How to set iOS app to use usb audio for input and output to internal speakers ios ios

How to set iOS app to use usb audio for input and output to internal speakers


I think you can only achieve input via USB device and output through the speakers when the USB device has no audio output component.

I can't find any documentation that says exactly this, but my reasoning is as follows:

Mixing and matching audio devices is done via the generalised version of AVAudioSessionCategoryPlayAndRecord, the so called multi-route category (AVAudioSessionCategoryMultiRoute) and its documentation in AVAudioSession.h says that

  1. Input is limited to the last-in input port.
  2. AVAudioSessionPortBuiltInSpeaker is only allowed to be used when there are no other eligible outputs connected

Point 1 is not a problem, but point 2 disallows your adapter 2 scenario.

NB This would allow adapter 1 & 2 to both work with USB input and line-out or headphones. Would that be of any use to you?


This is a bit of a long shot, but have you tried..

[session setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil]

..instead of overrideOutputAudioPort:?