multiple instances

Home Forums OpenEars multiple instances

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

  • Author
    Posts
  • #1022807
    boombatz
    Participant

    HI,
    Not sure if this is iOS 8. I have a button which lets the user “try again” and it takes them back to the VC that is running opening ears When they go in the second time it appears that open ears is running several instances. Is there a way to stop open ears and flite when it exits and then start it up again when the user goes back into the VC?
    Thanks

    #1022808
    Halle Winkler
    Politepix

    Hello,

    Yes, it’s always a requirement to stop instances of Pocketsphinx when leaving a view controller. Check out the documentation and the sample app to see how to do that.

    #1022822
    boombatz
    Participant

    Got it. Thanks a lot.

    #1022825
    boombatz
    Participant

    OK, I might be a dunce (probably am), but I cannot find what you are referring to in either the documentation or the sample app. Can you please point me in the right direction.
    Thanks.

    #1022826
    boombatz
    Participant

    I’m using your sample code and I do lazy instantiate pocketsphinx, but it is nil every time the view controller comes back and reinstantiates another one. Is there a way to kill the instance of pocketshinx in prepare to seque, or is there a better way?
    Thanks a lot for the help.

    #1022827
    boombatz
    Participant

    so here’s what’s happening. I am lazily instantiang the instances, but when I come back from another VC I see these messages on the console. Clearly it’s running a few times. I see single messages while I’m still in the same VC. Help!!

    Pocketsphinx has resumed recognition.
    Pocketsphinx has resumed recognition.
    Pocketsphinx has detected speech.
    Pocketsphinx has detected speech.
    Has finished speaking
    Has finished speaking
    Pocketsphinx has detected a second of silence, concluding an utterance.
    Pocketsphinx has detected a second of silence, concluding an utterance.

    #1022828
    Halle Winkler
    Politepix

    You have to first call stopListening and also set any OpenEarsEventsObserver delegates to nil before leaving the view. It isn’t safe to leave until you have the callback in pocketsphinxDidStopListening that indicates that your attempt to stop listening completed. When you are looking for this info in the docs, check the method descriptions for the class you are working with.

    #1022833
    boombatz
    Participant

    Fixed it. Thanks a lot, Halle. Works great now.

    #1022835
    Halle Winkler
    Politepix

    Super!

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