Reputation: 61
I am trying to record audio by Bluetooth headset mic and play by device speaker. I have seen few stack-overflow post regrading the same but still i am not getting is this possible or not ? and if possible then how to do it? if someone have any idea please inform me.
Upvotes: 4
Views: 953
Reputation: 1275
It's possible. Use bluetooth option when setting audio session category.
let audioSession = AVAudioSession.sharedInstance()
_ = try? audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord, with: .allowBluetooth)
_ = try? audioSession.setActive(true)
Upvotes: 1