Audio Session Behavior

Home Forums OpenEars Audio Session Behavior

Viewing 7 posts - 1 through 7 (of 7 total)

  • Author
    Posts
  • #1017261
    anujseth
    Participant

    Hey

    There is an older thread on this but just wanted to be sure if this is still the way to go, https://www.politepix.com/forums/topic/flitecontroller-pauses-music/

    I have an app (https://itunes.apple.com/us/app/hiit-stopwatch-for-iphone/id585542275?mt=8) that uses a lot of audio stuff and I’m trying to remove flite (which I was using directly) and add open ears but I’m getting horribly confused with the audio session behavior.

    I have double and triple checked my audio session initialization but the problems are consistent. Also the strange bit is that open ears will silence music after saying something but other sounds which are separate AVAudioPlayers will continue to work.

    Any suggestions on how I can control the open ears audio session setup ?

    #1017262
    Halle Winkler
    Politepix

    Hi,

    Correct, there is no issue with AVAudioPlayer because it can make use of the playandrecord audio session setting, but background sounds and music use other categories that conflict with playandrecord due to what seems like an audiosession services bug. The suggestion in the other thread sounds like it would work fine for your requirements, what specifically about it is confusing? Maybe I can help.

    #1017263
    anujseth
    Participant

    Alright I’ll try the suggestions from the thread and get back.

    #1017264
    anujseth
    Participant

    Yup this works,

    
    // keep music playing
            AudioSessionManager *oeAudioSessionManager = (AudioSessionManager *) [AudioSessionManager sharedAudioSessionManager];
            oeAudioSessionManager.soundMixing = YES;
            
            // setup flite only after setting audio mixing
            self.fliteController = [[FliteController alloc] init];
            self.sltVoice = [[Slt alloc] init];
            self.rmsVoice = [[Rms alloc] init];   
    

    I also have my own audio session category code that takes care of ducking etc. as needed.

    Thanks.

    #1017265
    Halle Winkler
    Politepix

    Super!

    #1017321
    adamastern
    Participant

    anujseth, could you please point me in the right direction for enabling ducking?

    #1017322
    anujseth
    Participant

    This example shows how its done, http://developer.apple.com/library/ios/#samplecode/Breadcrumb/Introduction/Intro.html.

    Be sure to kill the audio session in the audioPlayerDidFinishPlaying:successfully: delegate call back else it will duck once and not restart.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.