iOS SDK 禁用内置麦克风
我正在开发一个通过辅助端口(麦克风)接收数据的 iOS 应用程序。
我们连接了示波器,现在可以在测试 iPhone 上测量频率和幅度。
然而,即使连接了辅助电缆,除了我们的外部 AUX 输入之外,iPhone 仍然会监听内部麦克风,从而削弱了我们的测量结果。
iPhone 肯定能识别连接的 AUX 线缆(内置扬声器已关闭)。
有没有办法以编程方式禁用内置麦克风?
或者
我们是否可以通过 AUX 端口发送一些特殊信号来禁用内置麦克风?
I am developing an iOS application that receives data through the auxiliary port (microphone).
We got oscilloscopes hooked up and are at the point where we can measure frequencies and amplitudes on a testing iPhone.
However, even with the auxiliary cable connected, the iPhone still listens to the internal microphone in addition to our external AUX input thus watering down our measurements.
The iPhone definitely recognizes the connected AUX cable (internal speakers are turned off).
Is there any way to programmatically disable the built-in microphone?
or
Is there some special signal we can send through the AUX port to disable the internal microphone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过对这个主题的大量研究,目前还没有办法及时做到这一点。
After much research on this topic, there is no way to do it at this moment in time.
如果您查看 音频会话编程指南 和
AVCaptureDevice
类参考< /a>,与设备输入源和音频路由相关的所有属性都是只读
。如果有任何用处,您可以检测是否插入了耳机或外部麦克风。 这里有一个与此相关的问题。
我不相信您可以在用户不实际按下静音开关的情况下禁用内置麦克风,但也许您可以存储内置麦克风记录的数据,然后将其从示波器进行的测量中过滤掉?我不知道你会如何实施这个;这只是一个理论。
希望这有帮助!
If you look at the Audio Session Programming Guide and the
AVCaptureDevice
Class Reference, all the properties relating to the devices input sources and audio routes arereadonly
.If it's of any use, you can detect whether or not headphones or an external mic are plugged in. Here's a question relating to that.
I don't believe you can disable the built-in microphone without the user physically pressing the silent switch, but maybe you could store the data recorded by the built-in mic and then filter it out of the measurements taken by the oscilloscopes? I don't know how you would go about implementing this; it's just a theory.
Hope this helps!