For some reason, my voice recorder app won\'t use AirPods as an input source. Upon beginning a recording, the input source changes from the AirPods to the iPhone microphone.
There are two ways to record and play audio while AirPods are connected. For both cases we will use AVAudioSessionCategoryPlayAndRecord
category. The trick is to manage AVAudioSession
s option set.
.allowBluetoothA2DP
option. This will allow you to listen audio via AirPods and record with internal mic..allowBluetooth
option. With this option you can record audio with AirPods during playback. But in this case audio quality will be reduced.