如何检查麦克风是否插入 iPhone? [英] How can I check if a microphone is plugged into the iPhone?

查看:53
本文介绍了如何检查麦克风是否插入 iPhone?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 AVFoundation 框架中使用 AVAudioRecorder.我想知道如何检查插入的麦克风设备(在 iPod Touch 上)?

I'm using AVAudioRecorder in the AVFoundation framework. I'm wondering how I can check for a microphone device being plugged in (on the iPod Touch)?

推荐答案

设备支持 部分是你的朋友

在 iPhone OS 3.0 及更高版本中,使用AVAudioSession 类来判断是否音频输入可用.这个班解释了许多不同的来源基于 iPhone OS 的音频输入设备,包括内置麦克风、耳机插孔和连接的配件.更多信息,请参阅 AVAudioSession 类参考.

In iPhone OS 3.0 and later, use the AVAudioSession class to determine if audio input is available. This class accounts for many different sources of audio input on iPhone OS–based devices, including built-in microphones, headset jacks, and connected accessories. For more information, see AVAudioSession Class Reference.

这篇关于如何检查麦克风是否插入 iPhone?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆