Stops Listening if Siri is activated

Home Forums OpenEars Stops Listening if Siri is activated


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

  • Author
  • #1018450


    I get the following Log messages:
    Pocketsphinx calibration has started.
    Pocketsphinx calibration is complete.
    Pocketsphinx is now listening.

    OpenEars resign to work after I hit the Siri button on the keyboard. When Siri is finished with it’s speech to text am I getting this log message:
    !!! _NSLayoutTreeGetBaselineOffsetForGlyphAtIndex invalid glyph index 0

    How can I restart Openears after Siri was active?

    Halle Winkler


    Siri is by necessity going to override the important audio unit and audio session settings, so there is a good chance this simply isn’t possible as you’ve specified it. But, something you can try is to set pocketsphinxController.audioSessionMixing = TRUE and making sure that you suspend PocketsphinxController before using Siri and resume it afterwards. To the best of my knowledge _NSLayoutTreeGetBaselineOffsetForGlyphAtIndex is a bug in the Siri UITextView object in iOS 7 and isn’t related to OpenEars, which contains no graphics or typographical code.

    Take a look at using OpenEarsLogging and verbosePocketsphinx to learn how to turn on OpenEars’ logging functionality so you can see what is actually happening, since the log messages you mentioned look more like the sample app’s NSLog statements.


    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?


    – (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

    Halle Winkler

    Hi Ben,

    Looks right to me.


    I’ve been unable to narrow down a similar bug where starting/stopping Siri triggers the proper interrupt begin/end callback, but subsequent starting/stopping of Siri only triggers the interruption begin callback. I’ve seen it happen in the sample app, but it takes some serious button mashing.

    I’m on a time crunch so I ended up moving my interrupt functionality to happen via the applicationWillResignActive and applicationDidBecomeActive lifecycle callbacks. Just wanted to leave this here for those stumbling upon the thread looking for a solution, albeit not necessarily the proper one!

    Halle Winkler

    OK, this may be helpful to a later reader so I’m going to leave it place, but with the proviso that that earlier discussion in this thread is old and can’t be used with OpenEars’ 2.x and later API.


    Good addendum. And to clarify: I’m currently using 2.041.

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