aarons22
aarons22

Reputation: 147

AVAudioSessionCategoryPlayAndRecord doesn't detect mute switch

I'm using AVAudioSessionCategoryPlayAndRecord to detect the user blowing into the mic since I want other sounds to keep playing. However, if the mute switch is on, I don't want any audio to play but I still want to record.

Obviously I could just use some IF-THEN logic and change it to AVAudioSessionCategoryRecord if the mute switch is on, but I'm having trouble detecting that (from the looks of another user, the solution that worked before doesn't seem to work on iOS5).

So my question has two parts:

  1. Has anyone figured out how to detect the mute switch on iOS 5?

  2. If not, is there a way to manipulate AVAudioSessionCategoryPlayAndRecord to detect the mute switch (According to Apple, AVAudioSessionCategoryPlayAndRecord is not affected by the mute switch)

Upvotes: 3

Views: 2060

Answers (1)

Oliver
Oliver

Reputation: 23500

We won't be able to detect the silent switch state anymore since iOS 5...

The answer from Apple is there on the accepted answer : Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working?

Upvotes: 3

Related Questions