@ジェシカ、それはできません。制限されているためです。アプリケーションで試してみたい場合、アプリは App Store で拒否される可能性があります。
したがって、パブリック API を使用することはできません。
あなたが見つけたリンクはプライベート API を使用していますが、これは文書化されていないか、期待どおりに動作することが保証されていません。プライベート API を呼び出す App Store アプリをリリースしようとすると、自動的に拒否されます。
サイレントかどうかを確認したい場合は、以下のコードを使用してください。
    -(BOOL)silenced {
         #if TARGET_IPHONE_SIMULATOR
             // return NO in simulator. Code causes crashes for some reason.
             return NO;
         #endif
        CFStringRef state;
        UInt32 propertySize = sizeof(CFStringRef);
        AudioSessionInitialize(NULL, NULL, NULL, NULL);
        AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &state);
        if(CFStringGetLength(state) > 0)
                return NO;
        else
                return YES;
        }
For completeness, building off this link from Dan Bon, I implement the following method to solve this problem in my apps. One thing to note is that the code checks for the iPhone simulator first - executing the below code will crash the simulator. Anyone know why?
-(BOOL)silenced {
     #if TARGET_IPHONE_SIMULATOR
         // return NO in simulator. Code causes crashes for some reason.
     return NO;
     #endif
    CFStringRef state;
    UInt32 propertySize = sizeof(CFStringRef);
    AudioSessionInitialize(NULL, NULL, NULL, NULL);
    AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &state);
    if(CFStringGetLength(state) > 0)
        return NO;
    else
        return YES;
}
ビューコントローラーでこの権利を宣言すると、簡単に確認できます
if ([self silenced]) {
     NSLog(@"silenced");
else {
     NSLog(@"not silenced");
}