My application wants to access only Airpod's microphone (not speakers) but when I try to start recording from my app it turns of the music if it is playing. How can I only use Airpod's microphones. I dont want to stop any music that is being played by another application.
I tried to do the following. This code snippet can actually take input from Airpod's microphone but stops any other song that is being played.
try recordingSession.setCategory(.playAndRecord, mode: .measurement, options: .allowBluetooth)
try recordingSession.setActive(true)
audioRecorder = try AVAudioRecorder(url: audioFilename, settings: settings)
audioRecorder.delegate = self
audioRecorder.isMeteringEnabled = true
audioRecorder.prepareToRecord()
audioRecorder.record()
I dont want to stop any music that is being played by another application. I just want to use Airpod's microphones
Try this
And in you
AppDelegate
add this code snipped todidFinishLaunchingWithOptions