Detecting the iPhone’s Ring / Silent / Mute switch using AVAudioPlayer not working?

Well I found the answer thanks to someone from the Developer Forums, and you guys aren’t gonna like it!

I’ve had a response from Apple on this.

They’ve said they don’t and never have provided a method for detecting hardware mute switch and don’t intend to do so.

🙁

IMO there is definitely value in detecting the silent switch and notifying the user in case they’ve forgotten it was on… I’ve had people complain that they don’t have any sound and the silent switch was the reason! Oh well.

PS: If you would like Apple to add this feature (and of course you do!) please file a new “Enhancement” bug report for “iPhone SDK” at http://bugreport.apple.com/

Update: While there is still no official way to check the status of the mute switch, there’s a workaround/library called “SoundSwitch” that seems to do the trick. Check out the new accepted answer for the link.

Leave a Comment

tech