benwirz

Forum Replies Created

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

  • Author
    Posts
  • in reply to: Issue with AudioSession interruptions #1024663
    benwirz
    Participant

    Try stopping you avaudio instances in the pocketsphinxDidStopListening call back. This solved a similar issue for me. -Ben

    – (void) pocketsphinxDidStopListening
    {
    // stop the audio sessions here after pocketspinx has already stopped
    if (_speechSynthesizer &&
    _speechSynthesizer.speaking)
    [_speechSynthesizer stopSpeakingAtBoundary: AVSpeechBoundaryImmediate];
    if (_audioPlayerVoiceControlStart &&
    _audioPlayerVoiceControlStart.playing)
    [_audioPlayerVoiceControlStart stop];

    NSLog(@”Pocketsphinx has stopped.”);
    }

    in reply to: Poor Recognition after Stopping & Restarting #1024649
    benwirz
    Participant

    Hi Halle,

    The symptoms goes away if I DON’T make the stopListening call when going into the background. Now I’m only calling stopListening during an audio interruption or route change. I believe that my AVAudioPlayer instances were interfering with the stopListening in some way. I had been stopping the instances right before making the stopListeningCall. The trick turned out be to stop them in the didStopListening delegate call back. This way I only try to stop them after I know OEPocketsphinxController has itself stopped avoiding the conflict. This seems to work fine for the audio interruption related situations but for not going to the background.

    I think this solves this issue, thanks for your help!

    -Ben

    in reply to: Poor Recognition after Stopping & Restarting #1024645
    benwirz
    Participant

    Hi Halle,

    My app doesn’t run in the background and I’m not trying to do background recognition. Not sending [OEPocketsphinxController sharedInstance] stopListening] in the appWillResignActive solves the problem for going to the background and returning from the background. I also don’t get the get the red bar across the top like the previous 1.x version. I’ll test the audio interruptions next.

    Thanks
    Ben

    BTW I understand the necessity of creating a simple test case and I’m happy to do so if required but I just wanted to make sure that I’m using it correctly before going to the effort of putting a test case together for you.

    in reply to: Poor Recognition after Stopping & Restarting #1024642
    benwirz
    Participant

    Hi Halle,

    Thanks for the instantaneous reply! Just to make sure I understand correctly, should I execute [OEPocketsphinxController sharedInstance] stopListening] in the appWillResignActive notification or appEnteredBackground notification?

    I noticed the example app doesn’t do this but I used to get the Red Bar across the top after pressing the home button if I didn’t send the stopListening in the previous 1.x versions so I left in it for the new version as well.

    Thanks,
    Ben

    in reply to: Stops Listening if Siri is activated #1018510
    benwirz
    Participant

    I was able to solve the problem of Siri/Voice Control breaking OpenEars after the user holds the home button on iOS7 with the following code. Do you think this is the correct technique?

    Thanks,
    Ben

    – (PocketsphinxController *)pocketsphinxController {
    if (pocketsphinxController == nil) {
    pocketsphinxController = [[PocketsphinxController alloc] init];
    pocketsphinxController.returnNbest = TRUE;
    pocketsphinxController.nBestNumber = 2;
    pocketsphinxController.audioSessionMixing = true; // Allow audio interuptions
    }
    return pocketsphinxController;
    }

    // User started Voice Control / Siri
    – (void) audioSessionInterruptionDidBegin
    {
    [pocketsphinxController suspendRecognition];
    [pocketsphinxController stopListening];
    pocketsphinxController = nil;
    }

    – (void) audioSessionInterruptionDidEnd
    {
    [self setupOpenEars]; // Restart Open Ears after the Interruption Ends
    }

    in reply to: OpenEars & Finch #1017970
    benwirz
    Participant

    Thanks for the thoughtful reply Halle. You do an excellent job supporting your customers. One suggestion I would offer is that you should add this info to the FAQ. It would have saved me 2-3 days of time to know that OpenAL and System Sounds are incompatible with OpenEars. I’m sure this info is buried in the forums somewhere but I didn’t find during the search I did prior to starting. I’ll give AVAudioPlayer a try. Thanks again. -Ben

    in reply to: OpenEars & Finch #1017959
    benwirz
    Participant

    Hi Halle,

    Thanks for the reply. Everyone seems to recommend using OpenAL for short sound effects where the starting time latency is important and AVAudioPlayer for background music. I see this recommendation repeated time and time again online. Is it the case that it’s not possible to use OpenAL/Finch with OpenEars or you don’t feel that it is required for my application? If there is variable latency between the user pressing the start recording button and the phone playing the start tone, I’m worried it will create a bad user experience.

    Also, if I start using the FliteController will it conflict with AVAudioPlayer?

    Thanks,
    Ben

    in reply to: OpenEars & Finch #1017950
    benwirz
    Participant

    Also I should note that I repeated the test using a systemsounds instead of Finch and I get the same result. Starting pocketsphinxController seems to stop both.

    -Ben

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