简体   繁体   English

如何从iOS设备的蓝牙耳机录制声音?

[英]How to record voice from a Bluetooth headset for iOS device?

I have an application that needs to record voice from Bluetooth headset. 我有一个需要从蓝牙耳机录制语音的应用程序。 It needs work like Siri or Google Assistant. 它需要像Siri或Google Assistant这样的工作。 When I press button in App, it records voice from Bluetooth MIC rather than build in Mic. 当我在App中按下按钮时,它会记录来自蓝牙MIC的声音,而不是内置麦克风。 Is that possible? 那可能吗? My understanding is 1) either the Bluetooth is an Apple certificated External Accessory 2) or the Headset can implement a HFP like protocol to active a HFP link ? 我的理解是1)蓝牙是Apple认证的外部附件2)还是耳机可以实现类似HFP的协议来激活HFP链接? Any hints? 有什么提示吗?

If all you need is recording, it's quite straight if your bluetooth device is paired with iOS. 如果您只需要录制,则将蓝牙设备与iOS配对非常简单。 All bluetooth headset with microphone will work well. 所有带麦克风的蓝牙耳机都可以正常工作。

When you start to record, I think you have already changed your audio session category to play and record. 当您开始录制时,我想您已经将音频会话类别更改为播放和录制。

Then you can check all your available input route with 然后,您可以使用以下命令检查所有可用的输入路线

-[AVAudioSession availableInputs]

and iterate to find the bluetooth, then set it with 并反复查找蓝牙,然后将其设置为

-[AVAudioSession setPreferredInput:error:]

Sometimes it will fail, you need to check the output parameter error to find if there is something wrong. 有时会失败,您需要检查输出参数错误以查找是否有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS:如何从蓝牙耳机录制使用音频队列? - ios: how to record from bluetooth headset use audio queue? iOS - 可以录制蓝牙耳机麦克风的音频并播放设备扬声器 - iOS - is possible to record audio from Bluetooth headset mic and play in device speaker iOS-如何使用蓝牙耳机作为音频输入来录制视频? - iOS - How to record a video using a bluetooth headset as audio input? 记录来自iPhone中的蓝牙耳机的输入 - record input coming from bluetooth headset in iPhone 使用手机录制音频,但通过iOS中的蓝牙耳机播放录制 - Record audio with phone, but play record through bluetooth headset in iOS iPhone / iOS - 连接和断开蓝牙耳机 - iPhone/iOS - connect and disconnect from a Bluetooth headset 从无线耳机录制音频并通过蓝牙扬声器播放 - Record Audio From wireless Headset and Play it Through Bluetooth speaker 即使ipad在蓝牙连接列表中显示设备名称,iOS App也无法检测到蓝牙2.0耳机 - iOS App not detecting Bluetooth 2.0 headset even when the ipad is showing the device name in Bluetooth connected list 在iOS中以编程方式连接蓝牙耳机吗? - Connect Bluetooth headset programmatically in iOS? iOS:如何在音乐应用程序中的蓝牙耳机中播放缓冲音频? - iOS: How to play buffering audio in bluetooth headset in my music app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM