Menu

Recognize the speech via wav file by pocketsphinx_batch

Help
2016-03-28
2016-03-30
  • Toan Nguyen

    Toan Nguyen - 2016-03-28

    Dear cmusphinx,

    I noticed that the tool pocketsphinx_batch from pocketsphinx can recognize
    the speech via wav file.

    Could you please tell me how to use this tool in android os or write some
    source code to implement exactly like it does.

    Yours sincerely, Toan

     
    • Nickolay V. Shmyrev

       
      • Nickolay V. Shmyrev

         
      • Toan Nguyen

        Toan Nguyen - 2016-03-29

        @Mr. Nickolay V. Shmyrev
        I already tried your solution. But my app gets crashed at the command line below

        Config c = Decoder.defaultConfig();

        Please tell me how to fix it.

         
        • Nickolay V. Shmyrev

          I'm not sure what do you mean by "crashed", you need to provide more details.

           
  • Toan Nguyen

    Toan Nguyen - 2016-03-29

    It means my android app is forced close instantly as soon as running the command above

     

    Last edit: Toan Nguyen 2016-03-29
    • Nickolay V. Shmyrev

      It must print something in logcat, you should check it out first of all.

       
  • Toan Nguyen

    Toan Nguyen - 2016-03-30

    The attachment file is the log error
    I am using the source code from github
    https://github.com/cmusphinx/pocketsphinx-android-demo

     

    Last edit: Toan Nguyen 2016-03-30
    • Nickolay V. Shmyrev

      And, did you try to think on this error? Did you try to google for it? This error is very easy to solve if you turn on your brains for a second.

       
  • Toan Nguyen

    Toan Nguyen - 2016-03-30

    I already added jni so file to your project properly but it does not work

     

    Last edit: Toan Nguyen 2016-03-30
  • Toan Nguyen

    Toan Nguyen - 2016-03-30

    Could you please try to run your sample code like you suggest to check whether it works or not

     
    • Nickolay V. Shmyrev

      I already added jni so file to your project properly but it does not work

      No you did not load the JNI library, this is what your log says.

      Could you please try to run your sample code like you suggest to check whether it works or not

      It works fine

       
  • Toan Nguyen

    Toan Nguyen - 2016-03-30

    Sorry, I already figured out the bottom line here is

    I have to add the command below

        recognizer = defaultSetup()
                .setAcousticModel(new File(assetsDir, "de-cont"))
                .setDictionary(new File(assetsDir, "voxforge.dic"))
    
                        // To disable logging of raw audio comment out this call (takes a lot of space on the device)
                .setRawLogDir(assetsDir)
    
                        // Threshold to tune for keyphrase to balance between false alarms and misses
                .setKeywordThreshold(1e-45f)
    
                        // Use context-independent phonetic search, context-dependent is too slow for mobile
                .setBoolean("-allphone_ci", true)
    
                .getRecognizer();
        recognizer.addListener(this);
    
     

    Last edit: Toan Nguyen 2016-03-30
  • Toan Nguyen

    Toan Nguyen - 2016-03-30

    Before the command line

    Config c = Decoder.defaultConfig();

    And It works

     

Log in to post a comment.