T2S breaks video/audio capturing in progress

Home Forums OpenEars T2S breaks video/audio capturing in progress

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

  • Author
    Posts
  • #1015633
    HarryS
    Participant

    Hi,

    First of all thanks for providing the OpenEars framework.

    I use T2S to inform the user on special events during video recording. This means I have a video / audio capturing session active (AVFoundation) and want to issue some short texts when reaching certain locations. Problem is, every time I issue a message using say:withVoice:, the capturing session is stopped. The error I receive is “Recording Stopped”. Reason I can certainly think of is the Audio devices (actually output) are used / changed while the capturing session uses it as well (actually input) – which in turn makes iOS stop the capturing session.

    Any idea on a work around? Does T2S maybe claim more privileges than necessary (particularly Audio input)? Is it possible to disable and audio input / mic access (I do not use speech recognition).

    Thanks for your thoughts and insights.

    – Harry

    #1015634
    Halle Winkler
    Politepix

    Welcome,

    Is T2S referring to OpenEars’ text to speech, or is that another framework you are also using?

    #1015635
    HarryS
    Participant

    Oh yes, certainly. It is a FlintController created during app startup, receiving the say:withVoice: message. So for T2S the simplest solution you can think of. I have the latest framework version installed.

    – Harry

    #1015636
    Halle Winkler
    Politepix

    Got it, OK. TTS is the conventional term (wanted to let you know so if you need to ask questions elsewhere folks will immediately know what it’s about). You’re correct, FliteController is reasserting a PlayAndRecord audio session and you’re right that it only needs playback if you have no use for speech recognition. What you can try is to change the audio session that AudioSessionManager asserts and then recompile the framework and see if it helps. You’ll make the change in AudioSessionManager.m. If you look around line 271 of that file you’ll see a commented-out list of audio session types, and you’ll basically want to do a search and replace for kAudioSessionCategory_PlayAndRecord, replacing it with the other audio session types you want to try as the audio session that FliteController reasserts before its playback. You could also comment out invocations to AudioSessionManager in the framework and see if it just does the right thing without any interaction with the audio session.

    #1015637
    HarryS
    Participant

    That did it, great! I just replaced kAudioSessionCategory_PlayAndRecord by kAudioSessionCategory_AmbientSound – which seems to be the least exclusive setting for TTS – and recompiled the framework. Worked immediately.

    Thanks for the fast and qualified support!

    – Harry

    #1015638
    Halle Winkler
    Politepix

    Super, happy to hear it was so easy!

    #1018977
    pasupathi
    Participant

    Hi Thank you for your guide lines to solve this issue.i have other problem video files recorded video is freeze every single second i click that TTS call method at a time.i don’t know how to solve that in this case video is corrupted to upload to server video have some data but video is not played the duration show Zero.Please Help.

    #1018991
    pasupathi
    Participant

    Hi,
    i need your help my video frame is freeze when i call TextToSpeech method call at a particular time and particular frame is freeze the output video show at a particular time when i call TTS method the frame is Still.How to solve this?
    Thank you.
    -Pasupathi.

    #1018992
    Halle Winkler
    Politepix

    Welcome pasupathi,

    I’m sorry, this doesn’t sound like an OpenEars issue. Video playback during TTS isn’t designed to be supported by OpenEars and the programming problem being encountered is with the video and network API — the contribution of the TTS to it sounds like maybe it is blocking a thread you are also using for your other two operations, but there is no way of knowing based on the information being given.

    #1018995
    pasupathi
    Participant

    Hi,
    Thank you for your replay.if u know any other idea please refer me.
    -Pasupathi

    #1018997
    pasupathi
    Participant

    Hi Halle,

    i am use this code to avoid freeze video During Call TTS method.
    Now it is work only avoid total freezing Video,During the time i call TTS method in between frames are freeze my video otherwise good.

    AudioSessionManager *oeAudioSessionManager = (AudioSessionManager *) [AudioSessionManager sharedAudioSessionManager];
    oeAudioSessionManager.soundMixing = YES;
    [self.fliteController say:quesLab.text withVoice:self.slt];

    AudioSessionManager.m in this file, I just replaced kAudioSessionCategory_PlayAndRecord by kAudioSessionCategory_AmbientSound

    [videoWriterInput markAsFinished]; method to avoid freezing session.
    My Problem during calling TTS at a few seconds my video is freeze(like still Image)

    Thank you.

    -Pasupathi.

    #1018999
    Halle Winkler
    Politepix

    You can also try setting FliteController’s noAudioSessionOverrides to TRUE in order to completely turn off OpenEars’ audio session management. If your issue is related to the session type this might be helpful and it may not have any downsides for an app that doesn’t use any of the speech recognition capabilities of OpenEars.

    #1019000
    pasupathi
    Participant

    Hi ,
    Thank you for your fast replay.
    self.fliteController.noAudioSessionOverrides=YES;
    i think you say like this but i have doubt where i setting it.
    AudioSessionManager *oeAudioSessionManager = (AudioSessionManager *) [AudioSessionManager sharedAudioSessionManager];
    oeAudioSessionManager.soundMixing = YES;
    self.fliteController.noAudioSessionOverrides=YES;
    [self.fliteController say:quesLab.text withVoice:self.slt];

    That is correct or not?

    -Pasupathi.

    #1019001
    Halle Winkler
    Politepix

    Just remove all of the usages of AudioSessionManager and set self.fliteController.noAudioSessionOverrides in your lazy allocation of fliteController so it is always set when an fliteController is allocated before any speech is attempted. I think that should do it.

    #1019003
    pasupathi
    Participant

    Hi,
    once again thank you, I am remove audio session only add self.fliteController.noAudioSessionOverrides it is freeze total video at first frame.
    -Pasupathi.

    #1019005
    Halle Winkler
    Politepix

    OK, then it probably isn’t an issue with FliteController, since FliteController’s only AV object is AVAudioPlayer if you aren’t using the AudioSessionManager and that shouldn’t be creating any issues for you. This is probably on the video/network side.

    #1019006
    pasupathi
    Participant

    Hi,
    oh ok thank you for your help.I don’t know total video work using AudioSessionManager *oeAudioSessionManager = (AudioSessionManager *) [AudioSessionManager sharedAudioSessionManager];
    oeAudioSessionManager.soundMixing = YES;
    but call filter controller say:withvoice call particular time freeze video.
    Thank you.
    -Pasupathi.

    #1019007
    Halle Winkler
    Politepix

    OK, well I wish you good luck with your project and hope you can get it sorted out!

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