`
linwwwei
  • 浏览: 216479 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

如果获取耳机插入的事件

 
阅读更多
UInt32 dataSize; CFStringRef currentRoute; currentRoute = NULL; dataSize = sizeof(CFStringRef); AudioSessionInitialize(NULL, NULL, NULL, NULL); AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &dataSize, &currentRoute); if([(NSString *) currentRoute hasPrefix: @"Headphone"]) { //插入耳机后想执行的操作 }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics