googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
645 stars 191 forks source link

The AudioEngine was been interruption by alarm clock #316

Open ruansf opened 6 years ago

ruansf commented 6 years ago

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?

jdduke commented 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?

ruansf commented 6 years ago

`- (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?

Performador commented 6 years ago

I tried to repo this and noticed that all sound stop on audio interruption.

Investigating.