Menu

Error when Trying to read LM in trie binary format By android studio

Help
2016-04-08
2016-04-09
  • nguyễn văn thịnh

    hi, i'm newbie. i built acoustic model and language model with pocketshinx and i have language model in file .lm.bin . but when I creat application android and run app, right after that app is shutdown. i see that log (in text below) . please tell me why? and help me fix them
    sory my english is bad. thank every one :)

    my setup function:

    private void setupRecognitzer(File assetsDir) throws IOException {
            // configure recognizer
    
            speechRecognizer = defaultSetup().setAcousticModel(new File(assetsDir,"digit"))
                    .setDictionary(new File(assetsDir, "digit.dict"))
                    .setRawLogDir(assetsDir)
                    .setKeywordThreshold(1e-45f)
                    .setBoolean("-allphone_ci",true)
                    .getRecognizer();
    
            speechRecognizer.addListener(this);
    
            //try to inogre creat keywoard-activation search
            // and add phonetic search
            //speechRecognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE);
    
            File languageModel = new File(assetsDir,"digit.lm.bin");
            speechRecognizer.addNgramSearch("KWS_SEARCH", languageModel);
        }
    

    and my log:

    04-08 21:41:38.196 18286-18312/com.example.nguyenvanthinh.funny D/AudioRecord: openRecord_l
    04-08 21:41:38.221 18286-18312/com.example.nguyenvanthinh.funny I/SpeechRecognizer: Load N-gram model /storage/emulated/0/Android/data/com.example.nguyenvanthinh.funny/files/sync/digit.lm.bin
    04-08 21:41:38.221 18286-18312/com.example.nguyenvanthinh.funny I/cmusphinx: INFO: ngram_model_trie.c(456): Trying to read LM in trie binary format
    04-08 21:41:38.224 18286-18312/com.example.nguyenvanthinh.funny E/ion: ion close failed!, fd=-1517038427, -1: Bad file number.
    04-08 21:41:38.224 18286-18312/com.example.nguyenvanthinh.funny E/[MALI][Gralloc-ERROR]: int alloc_device_close(hw_device_t*):844 Failed to close ion_client: -1517038427
    04-08 21:41:38.224 18286-18312/com.example.nguyenvanthinh.funny I/[MALI][Gralloc]: gralloc tlcMemClose refcount = 2
    04-08 21:41:38.231 18286-18286/com.example.nguyenvanthinh.funny A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9c in tid 18286 (nvanthinh.funny)
    
     
    • Nickolay V. Shmyrev

      It goes out of memory it seems, maybe your model is too large. Try to run with the same model on desktop.

       
      • nguyễn văn thịnh

        My language model is small. i try convert .bin to .arpa and it working, but i don't know why?

         
        • Nickolay V. Shmyrev

          To get help on this issue you can provide

          1) Your full project including original and converted model
          2) Information about your pocketsphinx version
          3) Information about your android platform

           

Log in to post a comment.