title: Detecting iPhone mute switch in iOS 5
body: <p>I know that Apple does not provide a way to detect the state of the iPhone <code>mute/silence</code> switch in <strong>iOS 5</strong>.  However, I have I tried a technique mentioned elsewhere to detect this by playing an audio file and measuring its runtime. However, even though my iPhone was muted, the audio file still played the entire duration.  I'm using <code>[AVAudioPlayer play]</code> and computing the time before <code>audioPlayerDidFinishPlaying</code> is called.  Do you know of a trick to play an audio file, which will complete early/immediately if the phone is muted?</p>