AVAudioSessionInterruptionNotification not trigger

2019-05-03 11:19发布

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.

1条回答
We Are One
2楼-- · 2019-05-03 11:51

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;
查看更多
登录 后发表回答