Multiple voice recognition threads running

Home Forums OpenEars Multiple voice recognition threads running

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

  • Author
    Posts
  • #1018140
    ThatGuyM
    Participant

    Hi, I added open ears to my project and wrote the code as described in the open ears tutorial. The recognition process works fine. But if I go back to the previous view controller and re-visit the same view controller where the open ears is being used, I see duplicated console out put.

    2013-08-27 11:59:14.781 MyApp[4078:907] Pocketsphinx calibration has started.
    2013-08-27 11:59:14.782 MyApp[4078:907] Pocketsphinx calibration has started.
    2013-08-27 11:59:16.982 MyApp[4078:907] Pocketsphinx calibration is complete.
    2013-08-27 11:59:16.983 MyApp[4078:907] Pocketsphinx calibration is complete.
    2013-08-27 11:59:16.985 MyApp[4078:907] Pocketsphinx is now listening.
    2013-08-27 11:59:16.986 MyApp[4078:907] Pocketsphinx is now listening.

    Any ideas?

    #1018141
    Halle Winkler
    Politepix

    Welcome,

    it’s necessary to call [self.pocketsphinxController stopListening] before leaving the view controller so that the speech recognition thread can be released and then the view controller can be released.

    #1019990
    chickenthief2
    Participant

    Same problem, but I am certainly calling self.pocketsphinxController stopListening] when leaving (through ibaction on a button) the view controller. The console says it has stopped. But when I re-enter the view controller, I get the duplicated output as above. Any help is much appreciated.

    #1019991
    Halle Winkler
    Politepix

    Welcome,

    The causes for this are that is some way the memory management in the app is leading to having more than one PocketsphinxController. When you call stopListening, that allows an instantiated PocketsphinxController to release its thread and objects, if the memory management is otherwise only instantiating a single instance of PocketsphinxController in your app. But if there is something else leading to there being multiple PocketsphinxControllers, stopListening alone isn’t going to prevent this issue, so the issue to check out and troubleshoot is memory management.

    This could also happen if you have multiple instances of your view controller or if something else about the view controller doesn’t allow all of its objects to release on exit. I’d start by making sure you’re using the lazy instantiation pattern shown in the tutorial for PocketsphinxController and then move on to checking out whether something else in the app structure is leading to multiple view controller instances. If this doesn’t help, you could make a very, very stripped-down example app for me demonstrating the issue and I’ll take a look at it, but it has to basically have no code in it other than this phenomenon or it won’t be possible to test.

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