开发者

Jack/earpiece detection in iphone

Anyone could tell me how to detect when a jack of an earpiece is plugged-i开发者_JS百科n into an ipad or iphone?

Thanks


I believe you can call AudioSessionGetProperty and then get the value "kAudioSessionProperty_AudioInputAvailable" to detect whether an audio jack has been plugged in.

I.e.

AudioSessionInitilize(NULL, NULL, NULL, NULL);
UInt32 propertySize, micConnected;
AudioSessionGetProperty(kAudioSessionProperty_AudioInputAvailable, &propertySize, &micConnected);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜