开发者

How can I check if a microphone is plugged into the iPhone?

I'm using AVAudioRecorder in the AVFoundation framework. I'm wondering how I can check f开发者_运维技巧or a microphone device being plugged in (on the iPod Touch)?


BOOL inputAvailable = [[AVAudioSession sharedInstance] inputIsAvailable];


Device Support section of the iPhone Application Programming Guide is your friend

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜