iOS:如何选择使用哪个麦克风(内置/外置)?
假设我有一个音频 iPhone 应用程序,它从麦克风获取输入。
现在,虽然我自己还没有尝试过,但我相信用户可以使用插入唱机插孔的外部麦克风。
这意味着我的音频单元可以从内部或外部麦克风接收输入。
我的猜测是,如果连接了外部麦克风,iOS 会自动路由。
但如果我不想这样怎么办?
有没有办法指定应使用哪个麦克风?
我查看了音频会话指南,我可以找到一些有关蓝牙耳机的设置。但这是我能找到的最接近的了。看来这是不可能的。但我发现这很难相信。
PS 我也很好奇它如何检测外部麦克风...如果我插入耳机,它应该继续从内部麦克风进行路由。我的耳机只是普通的立体声耳机。但如果我使用手机的耳机(在插孔上的额外带子上......它们在各个听筒线相遇的电缆上内置了一个麦克风)我希望它能够拾取这个源。
Let us say I have an audio iPhone app which takes input from the microphone.
Now, although I haven't tried this myself, I believe the user could use an external microphone that plugs into the phonojack socket.
This means my audio unit could be receiving its input from the internal or the external microphone.
My guess is that iOS will automatically route from an external microphone if it is connected.
But what if I don't want that?
Is there a way to specify which microphone should be used?
I have looked in the audio session guide, I can find some setting regarding a Bluetooth headset. But that is as close as I can find. It appears that it is not possible. But I find that difficult to believe.
PS Also I am curious how it detects an external microphone... if I plug my headphones in, it should continue routing from the internal microphone. my headphones are just plain stereo headphones. but if I used my mobile phone's headphones ( on extra band on the Jack... they have a microphone built onto the cable where the individual earpiece strands meet ) I would expect it to pick up this source instead.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用 AUHAL 单元将特定输入设备设置为默认输入,然后将其与 AudioQueue 连接。
Apple 有详细的技术说明:使用 HAL 输出音频的设备输入单位
You have to use the AUHAL unit to set a specific input device as default input and then connect it with the AudioQueue.
Apple has a detailled Technical Note for that: Device input using the HAL Output Audio Unit