在[iOS5]发布之前,我使用"AudioSessionGetProperty"找到了设备的"静音开关"状态.
CFStringRef route;
UInt32 propertySize = sizeof(CFStringRef);
AudioSessionInitialize(NULL, NULL, NULL, NULL);
AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &route);
if(CFStringGetLength(route) == 0) {
// Silent Mode
}
Run Code Online (Sandbox Code Playgroud)
现在,我想知道如何在"iOS5"中获得"静音切换"状态