Menu

Android CMU Sphinx .getRecognizer() Method Freezes App

Help
Eric
2018-03-22
2018-03-23
  • Eric

    Eric - 2018-03-22

    Hi All,

    I have a really strange issue when attempting to debug an android app I wrote that uses CMU Sphinx.

    This code:

    if(recognizer == null) {
                    Assets assets = new Assets(this);
                    File assetsDir = assets.syncAssets();
    
                    // Init the voice recognition
                    recognizer = defaultSetup()
                            .setAcousticModel(new File(assetsDir, "en-us-ptm"))
                            .setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
                            .setKeywordThreshold(1e-5f)
                            .getRecognizer();
    
                    recognizer.addListener(this);
                    recognizer.addKeyphraseSearch(getString(R.string.speech_recognizer_searchName), getString(R.string.speech_recognizer_keyword).toLowerCase());
                    recognizer.startListening(getString(R.string.speech_recognizer_searchName));
                }
    

    Sometimes works and sometimes doesn't. getRecognizer seems to lock up and never finish sometimes, and other times it works just fine (or at least the code continues). How do I troubleshoot or figure out why that's happening? No exception is thrown according to Android Studio.

    I'm using pocketsphinx-android-5prealpha-release. I hope that's the latest version.

     

    Last edit: Eric 2018-03-23
    • Nickolay V. Shmyrev

      It most likely means your sdcard is dying.

       

Log in to post a comment.