Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeException: Decoder_setSearch returned -1 #59

Open
spapapan opened this issue Mar 14, 2020 · 3 comments
Open

RuntimeException: Decoder_setSearch returned -1 #59

spapapan opened this issue Mar 14, 2020 · 3 comments

Comments

@spapapan
Copy link

I keep getting this error and I don't know why. Can someone explain me what it means?

@nshmyrev
Copy link
Contributor

Sure, as soon as you provide more details - the code changes you have made and the logcat output.

@spapapan
Copy link
Author

    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)

@nshmyrev
Copy link
Contributor

All logcat output, not just the last lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants