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

查看:330
本文介绍了如何检查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天全站免登陆