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