osxaudiosink/osxaudiosrc and AVAudioSession Interruption

Joel Loeshelle jml5qh at gmail.com
Fri Nov 18 16:30:16 UTC 2016


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);

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161118/93db5adb/attachment-0001.html>


More information about the gstreamer-devel mailing list