pocketsphinx-android-demo
pocketsphinx-android-demo copied to clipboard
RuntimeException: Decoder_setSearch returned -1
I keep getting this error and I don't know why. Can someone explain me what it means?
Sure, as soon as you provide more details - the code changes you have made and the logcat output.
private void setupRecognizer(File assetsDir) throws IOException {
// The recognizer can be configured to perform multiple searches
// of different kind and switch between them
recognizer = SpeechRecognizerSetup.defaultSetup()
.setAcousticModel(new File(assetsDir, "el-gr-ptm"))
.setDictionary(new File(assetsDir, "el-gr.dic"))
.getRecognizer();
recognizer.addListener(this);
recognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE);
recognizer.startListening(KEYPHRASE);
}
2020-03-14 18:29:44.146 17986-17986/edu.cmu.sphinx.pocketsphinx E/AndroidRuntime: FATAL EXCEPTION: main Process: edu.cmu.sphinx.pocketsphinx, PID: 17986 java.lang.RuntimeException: Decoder_setSearch returned -1 at edu.cmu.pocketsphinx.PocketSphinxJNI.Decoder_setSearch(Native Method) at edu.cmu.pocketsphinx.Decoder.setSearch(Decoder.java:181) at edu.cmu.pocketsphinx.SpeechRecognizer.startListening(SpeechRecognizer.java:122) at edu.cmu.pocketsphinx.demo.PocketSphinxActivity.startListening(PocketSphinxActivity.java:198) at edu.cmu.pocketsphinx.demo.PocketSphinxActivity.access$000(PocketSphinxActivity.java:63) at edu.cmu.pocketsphinx.demo.PocketSphinxActivity$1.onClick(PocketSphinxActivity.java:92) at android.view.View.performClick(View.java:6256) at android.view.View$PerformClick.run(View.java:24710) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:251) at android.app.ActivityThread.main(ActivityThread.java:6572) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
All logcat output, not just the last lines.