2
votes

I configured my audio session for kAudioSessionCategory_AmbientSound for an app which plays music with AVAudioPlayer. But problem is app also plays effects with OpenAL. I want music to play always (also in background) but OpenAL sound effects only if mute switch not muted.

2

2 Answers

2
votes

There is no documented way of doing it, but you can try this project. It is an open source project that claims it can detect if your mute switch state changes.

0
votes

One iOS-5-compatible trick (which the source that shabzco posted uses) is to play an audio recording of a known length. If the completion handler fires sooner than expected then the mute switch is probably on.