Sorry, I don’t know the cause of that. You can troubleshoot it more by testing with the default English acoustic model that ships with OpenEars 2.5 rather than a custom one, by testing using real devices only, and by testing against other unknown words.
I am using the English acoustic model shipped with Openears 2.5 is just a variable voiceVariable that I initialize depending on the device language.
What OpenEars initialization are you referring to specifically? The issue you have seems to only relate to OELanguageModelGenerator, but OEPocketsphinxController no longer is really initialized per se, since it just has a shared object. I would take a look at the way things are set up in the sample app and compare it to your app to make sure there isn’t any unnecessary or out-of-date code as another troubleshooting step.
I compared with the example and are the same steps.
It might be a good idea to look at the logging for this behavior when you stop the engine before the view controller is dismissed to see if it is able to shut down cleanly.
I am stopping the engine with stopListening method. But I don’t think it is releasing OELanguageModelGenerator variable.
Is there any way to release or clean the OELanguageModelGenerator before dismissing the viewController?
By the way, I just saw something strange:
When the problem was happening I was loading Spanish words to AcousticModelEnglish (just because I am testing the app, in the future the dictionary should only contains English words) but still if I change the Spanish words to 3 English words, I can reload the viewController as many time as I want without crashing….
Interesting enough is if I load english words to AcousticModelSpanish the crash is not happening. Does it help you to narrow the problem?
As I told you the dictionary will be with English or Spanish words depending the country and it will match with the AcousticModel accordingly. But what I am afraid of is if the dictionary contains any strange English word because the user types it incorrectly if the error will happen also and the app will not run ever because crashes every time the viewController is loaded.