Open ruansf opened 6 years ago
Just to be clear, you're saying that the issue is the alarm only ringing once? And that the alarm should continue to ring indefinitely while in VR?
`- (void)handleInterruption:(NSNotification *)notification {
NSDictionary *interuptionDict = notification.userInfo;
NSInteger interuptionType = [[interuptionDict valueForKey:AVAudioSessionInterruptionTypeKey] integerValue];
switch (interuptionType) {
case AVAudioSessionInterruptionTypeBegan:
{
[self.gvrAudioEngine stop];
}
break;
default:
break;
}
}`
I meant the alarm only ringing once. I call the method stop
to stop the engine when interruption happen. But the alarm clock just rang once. Is that method asynchronous?
I tried to repo this and noticed that all sound stop on audio interruption.
Investigating.
I plug in my headphones listening my app. I execute this call
stop
when interruption happen. When the alarm clock interrupt,the alarm clock just rang once. What prevented the alarm from going off?How to avoid this situation?