Airpods Not Working as an Input Source for Voice Recorder App

AVAudioRecorder/AVAudioSession with Apple Airpods

Turns out the issue we were having had to do with the category that was being set. Due to issues we were having with various Bluetooth output devices we set and keep the audio category set to AVAudioSessionCategoryPlayback except when we're ready to record.

Per this Stack post: AVAudioSession: Some Bluetooth devices are not working properly on my App

In the above code we switch the category over to AVAudioSessionCategoryRecord before we're about to record. While this works for the builtin mics and other bluetooth devices it did not work with AirPods. Instead, setting the category to AVAudioSessionCategoryPlayAndRecord allows recording to work with the AirPods.

I then still maintain a Playback only category for the session throughout the app for audio playback. Only switching to PlayAndRecord when about to record audio.

As a side note: Apple does not list the AirPods as an MFi device.

AVAudioSession.RouteChangeReason not detecting connected bluetooth headset/earphones

I just read the code and finally found what was wrong with it. The problem was that I was setting the category more than once so for some reason this was causing wireless headset/earpeace to not connect directly to the app.

Related Topics

Leave a reply