Check this thread – Detecting the iPhone’s Ring / Silent / Mute switch using AVAudioPlayer not working?
And this API – SoundSwitch
How it works:
- Play an audio file of 0.5 secs, every sec (after completion..)
- Check how long it took to play the sound
- Callback called real fast? nothing was played (silent switch is ON)
Enjoy!