[英]iOS - is possible to record audio from Bluetooth headset mic and play in device speaker
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.
如果有人有任何想法请通知我。
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)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.