简体   繁体   English

iOS - 可以录制蓝牙耳机麦克风的音频并播放设备扬声器

[英]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.

相关问题 从无线耳机录制音频并通过蓝牙扬声器播放 - Record Audio From wireless Headset and Play it Through Bluetooth speaker 使用手机录制音频,但通过iOS中的蓝牙耳机播放录制 - Record audio with phone, but play record through bluetooth headset in iOS iOS:如何从蓝牙耳机录制使用音频队列? - ios: how to record from bluetooth headset use audio queue? 如何从iOS设备的蓝牙耳机录制声音? - How to record voice from a Bluetooth headset for iOS device? iOS 7获取所有可用的音频设备(蓝牙,耳机,扬声器,手机) - iOS 7 Get all the available audio devices (bluetooth, headset, speaker, phone) 在iOS中以编程方式将呼叫音频路由从蓝牙耳机更改为iPhone扬声器 - Change Call Audio routing from Bluetooth Headset to iPhone Speaker in iOS programatically 是否可以通过编程将音频输出重定向到iOS中的手机扬声器或耳机 - Is it possible to Redirect audio output to phone speaker or headset in iOS programmatically iOS可以同时通过蓝牙和设备扬声器播放两个独立的音频流吗? - Can iOS play two independent audio streams through bluetooth and device speaker simultaneously? 如何将音频从设备扬声器路由到蓝牙扬声器? - How to route audio from device speaker to bluetooth speaker? iOS:如何在音乐应用程序中的蓝牙耳机中播放缓冲音频? - iOS: How to play buffering audio in bluetooth headset in my music app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM