osxaudiosink/osxaudiosrc and AVAudioSession Interruption

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

osxaudiosink/osxaudiosrc and AVAudioSession Interruption

jml5qh
I have successfully gotten osxaudiosink / osxaudiosrc to stream rtp audio on an iOS application, but I'm having trouble when the AVAudioSession gets interrupted. When the session gets interrupted, I deactivate the audio session. When the session interruption ends, I reactive the session. When I get an audio session interruption, do I need to pause the entire osxaudiosink / osxaudiosrc pipeline? I was trying to do some researching on AudioUnits and interruption but there isn't many details out there about this. Thanks for any help you can provide.

My code is below and the success variables are always YES.

- (void)handleAudioSessionInterruption:(NSNotification *)notification

{

    NSInteger interruptionType = [notification.userInfo[AVAudioSessionInterruptionTypeKey]integerValue];

    NSError *error;

    if (interruptionType == AVAudioSessionInterruptionTypeBegan)

    {

        //Interruption began, so we should stop audiosession

        BOOL success = [[AVAudioSession sharedInstance]setActive:NO error:&error];

        NSLog(@"Interruption began, session ended: %d", success);

    }

    else if (interruptionType == AVAudioSessionInterruptionTypeEnded)

    {

        //Interruption ended, so we should restart audiosession

        BOOL success = [[AVAudioSession sharedInstance]setActive:YES error:&error];

        NSLog(@"Interruption ended, session began: %d", success);

    }

    NSLog(@"got an error: %@", error);

}


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel