IOS - it is possible to record sound from the microphone of a Bluetooth headset and play it in the speaker of the device

I am trying to record audio using a bluetooth headset microphone and play back the device's speakers. I have seen several stack overflows that change, but still I don't get, is it possible or not? and if possible, how to do it? if anyone has any ideas please let me know.

+3


source to share


1 answer


It is possible. Use bluetooth option when configuring audio message category.



let audioSession = AVAudioSession.sharedInstance()
_ = try? audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord, with: .allowBluetooth)
_ = try? audioSession.setActive(true)

      

+1


source







All Articles