4

I'm having a problem with "AVAudioSessionInterruptionNotification" on iOS 7.0.4.
I sign up for it on the NSNotificationCenter, and I activate AVAudioSession. Everything works fine, but if a camera is activated, that particular notification is not triggered anymore, neither for the beginning of an interruption, nor for the end of it.
I test audio interruptions by receiving cell calls on an iPhone4, and also by making an alarm ring while the app is running. I also tried using the notification with the "AVCam" sample app, and I have the same problem.
What is the relationship between audio interruptions and camera activation? Why would audio interruptions stop being triggered if a camera is turned on? Could this be an iOS bug?

Edit jan 10, 2014: I updated to iOS 7.1 beta 3, and the problem is still present.

Thank you.

Axel83
  • 197
  • 2
  • 13
  • 2
    I have a similar issue: http://stackoverflow.com/questions/19844005/avaudiosession-interruptions (when I first read this question, it occurred to me that I never tested without the camera running; so immediately went to test - unfortunately the notification never triggers for me even without the camera running). I hope someone can give some useful help. – Doc Dec 11 '13 at 20:12
  • I had read your question too. However, I decided to create a new one because of the difference related to the camera activation. It is strange that you have the problem even if you don't activate the camera. Let's hope somebody will have some infos... – Axel83 Dec 11 '13 at 21:47

1 Answers1

6

set the camera/capture device object property usesApplicationAudioSession to NO and all will be fine

You can use AVCaptureSession:

captureSession = [[AVCaptureSession alloc] init];
...
captureSession.usesApplicationAudioSession = NO;
Marek R
  • 32,568
  • 6
  • 55
  • 140
helper
  • 76
  • 2