FlightController ducking when ipod music is playing

Home Forums OpenEars FlightController ducking when ipod music is playing

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

  • Author
    Posts
  • #1017705
    lbrt
    Participant

    I’ve been reading on the forums when it comes to ducking using flightcontroller and there seems to be a definite answer to this. The text to speech of openears is quite promising to use in an ios app. But I can’t seem to make any background music (played via the ipod player) to duck when I play a flightcontroller say function.

    Any help would be much appreciated. Thanks.

    #1017706
    Halle Winkler
    Politepix

    Welcome,

    I think you will have to make a change to AudioSessionManager.m and recompile the framework in order to do this.

    1. In your app class where you want to use TTS, import AudioSessionManager.h and send this message before instantiating FliteController: [[AudioSessionManager sharedAudioSessionManager]setSoundMixing:YES];

    2. In AudioSessionManager.m change this line:

            AudioSessionGetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, &overrideCategoryMixWithOthersCheckSize, &overrideCategoryMixWithOthersCheck);

    To this:

    AudioSessionGetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, &overrideCategoryMixWithOthersCheckSize, &overrideCategoryMixWithOthersCheck);
    
    UInt32 ducking = 1;
        AudioSessionSetProperty(kAudioSessionProperty_OtherMixableAudioShouldDuck, sizeof(ducking), &ducking);
    

    I haven’t tested this code, it’s just my best guess off the top of my head of what the ducking code referenced in the other thread would look like. Let me know if it works for you.

    #1017720
    lbrt
    Participant

    Hi Halle,

    This did the trick, at first I wasn’t considering recompiling the framework before i did this post. SO basically the solution is what you’ve said, adding the code above to AudiosessionManager. Setting shouldMix on AudiosessionManager after initializing the flightController.

    Thanks,
    lbrt

    #1017732
    Halle Winkler
    Politepix

    Super, thanks for the followup.

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