Does stopListening retain observers?

Home Forums OpenEars Does stopListening retain observers?

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

  • Author
    Posts
  • #1025953
    jvanroekel
    Participant

    If I do the following, will the observer still be active after the 2nd startListening()? In other words, is the list of observers independent of whether the controller is listening?

    startListening()
    create an observer
    stopListening()
    startListening()

    Thanks

    #1025954
    Halle Winkler
    Politepix

    Welcome,

    Can you clarify your question a bit? There isn’t anything I would describe as observer creation in OpenEars, or a startListening() function.

    #1025955
    jvanroekel
    Participant

    I am very sorry, I was being sloppy.

    I meant startRealtimeListeningWithLanguageModelAtPath in RapidEars.

    Clearly when I create an OEEventsObserver and assign a delegate, a connection is made to the singleton OEPocketsphinxController object. Is this lost when I call stopListening or can I restart listening and still have the observer delegate receive callbacks.

    Thanks

    #1025958
    Halle Winkler
    Politepix

    Hi,

    Clearly when I create an OEEventsObserver and assign a delegate, a connection is made to the singleton OEPocketsphinxController object.

    Although OEPocketsphinxController is able to send notifications to an OEEventsObserver if it exists, and to receive notifications from one if it exists, these two separate classes do not make connections to each other and their respective lifecycles are not connected.

    #1025960
    Halle Winkler
    Politepix

    I wanted to mention that OEEventsObserver has to be a property of your class in which you are using it, and that it needs to be instantiated before any calls to begin OEPocketsphinxController listening in order to provide information about the listening startup process. It is usually instantiated when the hosting view controller is initialized or when its view is loaded.

    Creating them at the moment of need and then uncreating them isn’t how they are designed – instead, management of which events to react to and when is handled by choosing the callbacks to use and having logic within them for what to do under which circumstance.

    You can check out the tutorial or the sample app in order to see how OEEventsObserver is managed in them.

    #1025963
    jvanroekel
    Participant

    Thanks, Halle.

    I’m trying to provide the option for the user to disable/enable voice control such that there is no overhead associated with the controller. I worried that even though I can suspend/resume the controller, it is still consuming CPU time.

    My plan now is to create all my OEEventsObserver and proxies first. Then call startRealtimeListeningWithLanguageModelAtPath only if the user has enabled voice control. I can call stopListinging later if the user disables voice input.

    I expect to make the final decision to purchase Rapid Ears soon, although the price is daunting for an individual developer.

    BTW, I really appreciate the way you have set up the demo version of RapidEars. I’m able to do a complete evaluation before purchasing.

    If you are interested, I’m adding voice control (and later Google Cardboard support) to my app, Walkers 3D. http://walkers3d.com

    John

    #1025964
    Halle Winkler
    Politepix

    Both suspend and resume, and starting and stopping, are the same in terms of CPU overhead – OEPocketsphinxController won’t put the CPU to any work while either suspended or stopped. Just don’t start and immediately suspend, since it will have a negative effect on calibration.

    #1025965
    jvanroekel
    Participant

    Ok, got it. Thanks so much for the prompt reply.

    #1025966
    Halle Winkler
    Politepix

    You’re welcome, good luck with your integration!

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