Reply To: pocketSphinx continuous recognition loop has failed

Home Forums OpenEars pocketSphinx continuous recognition loop has failed Reply To: pocketSphinx continuous recognition loop has failed

#1021425
Matt
Participant

Looking at the source, it appears the failure happens inside ContinuousModel.m prepareTestAndOpenAudioDevice method. At this point it fails to open an audio device and posts a PocketsphinxContinuousSetupDidFail notification. performContinuousFailureStopForIssue: never gets called.

If I work my way back, prepareTestAndOpenAudioDevice is called within listeningLoopWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF: at which point isListening=YES; prepareTestAndOpenAudioDevice fails and subsequently causes listeningLoopWithLanguageModelAtPath:… to return immediately.

Hopefully that is of some help in the future, after WWDC.

Sorry, not quite following this yet – why is it being set to nil while it is calibrating and/or why is it calibrating while it is stopping?

This is mostly for robustness. For example I have a button that allows toggling pocketsphinxController listening (start/stop listening). Because I ran into the issue above I am trying to nil the controller when the user toggles the button to off/stop. In fact this may be the way to go anyways to clear up resources. This presents the problem where the user can toggle the switch off while the controller is calibrating, etc.

Am I always guaranteed that pocketsphinxDidStopListening and/or pocketSphinxContinuousSetupDidFail will fire in the event that the controller fails?

Then I could safely nil the controller if something went wrong and allow the user or system to toggle listening back on (which would start with a fresh controller).