Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#351 Pocketsphinx Android bad accuracy

next release
wont-fix
nobody
9
2014-12-14
2013-08-12
Amritanshu
No

I have been working on Pocketsphinx Android demo with my own Acoustic model and Language Model. But I am getting 2 issues.

1) The application on android is working fine on one phone but at the same time its not working on the another phone. I am expecting the reason is something to do with decoder. It is depending on phone's processor speed to start decoder or not.

2) And the phone on which it is running, is giving me a very bad accuracy. But if I tested it on computer and accuracy was fairly good enough.

Here, I have attached my configuration file of the new model generated. And also I have attached pocketshinx log from my android phone.

This is what I have set the settings of the decoder in the android java source code.

            c.setFloat("-samprate", 16000.0);
    c.setInt("-maxhmmpf", 2000);
    c.setInt("-maxwpf", 10);
    c.setInt("-pl_window", 2);
    c.setBoolean("-backtrace", true);
    c.setBoolean("-bestpath", false);

    this.ps = new Decoder(c);

    this.audio = null;
    this.audioq = new LinkedBlockingQueue<short[]>();
    this.use_partials = false;
    this.mailbox = Event.NONE;

I know the settings for configurations and decoder should be same to get a good accuracy. Please if anyone can point me out with the settings where I have gone wrong.
Thank you

2 Attachments

Discussion

    • status: open --> wont-fix
     
  • Bad accuracy is not a bug. To ask for help use Help forum.

    To get help on accuracy provide raw dumps of the audio. To store raw audio uncomment rawlogdir configuration in sources. Raw log files will be stored on sdcard.

    You need to share raw files in order to get help on accuracy.

     
  • c.setFloat("-samprate", 16000.0);

    This is wrong, android demo requires 8000 Hz, not 16000. Or you need to change recorder settings too.

    c.setInt("-maxhmmpf", 2000);
    c.setInt("-maxwpf", 10);
    c.setInt("-pl_window", 2);

    This is wrong too. Those settings must be removed.

     
  • Amritanshu
    Amritanshu
    2013-08-12

    Thank you for your reply.
    I have been using 8000 Hz before when I was getting this error.

    INFO: Users/Amrit/workspace/pocketsphinx/src/libpocketsphinx/acmod.c(246): Parsed model-specific feature parameters from /storage/emulated/0/Android/data/edu.cmu.pocketsphinx/hmm/en_US/hub4wsj_sc_8k/feat.params
    FATAL_ERROR: "Users/Amrit/workspace/sphinxbase/src/libsphinxbase/fe/fe_sigproc.c", line 405: Failed to create filterbank, frequency range does not match. Sample rate 8000.000000, FFT size 512, lowerf 4765.625000 < freq -15.625000 > upperf 4218.750000.
    INFO: Users/Amrit/workspace/sphinxbase/src/libsphinxbase/util/cmd_ln.c(691): Parsing command line:

    Thats why I changed it to 16000Hz and it started running perfectly. I have removed other settings which you told and it still gave me the same error with 8000Hz.

    And i have attached my raw file with this, please have a look

     
    Attachments
  • I have been using 8000 Hz before when I was getting this error.

    You shouldn't have any problems if you are using unmodified demo with standard models. Revert your modifications or start from a clean start if you want to use demo.

    If you are using custom model care to mention that in the question.

    Thats why I changed it to 16000Hz and it started running perfectly. I have removed other settings which you told and it still gave me the same error with 8000Hz.

    Your audio is still recorded at 8000 hz, that's why accuracy is low. You need to change 8000 to 16000 in audio recorder constructor to record at 16khz.

     
  • Amritanshu
    Amritanshu
    2013-08-12

    I mentioned that I am using my model at the very start of my question. Can you please tell me how did you check the frequency from the raw file? And also how can I change my phones audio recorder constructor to record at 16khz?

     
  • Amritanshu
    Amritanshu
    2013-08-14

    Sorry, it was my mistake. I checked the trained speech samples and the recorded sample using raw file, the sample rate is 8000hz for both. I modified the code accordingly and I am still getting the same error.

    INFO: Users/Amrit/workspace/pocketsphinx/src/libpocketsphinx/acmod.c(246): Parsed model-specific feature parameters from /storage/emulated/0/Android/data/edu.cmu.pocketsphinx/hmm/en_US/hub4wsj_sc_8k/feat.params
    FATAL_ERROR: "Users/Amrit/workspace/sphinxbase/src/libsphinxbase/fe/fe_sigproc.c", line 405: Failed to create filterbank, frequency range does not match. Sample rate 8000.000000, FFT size 512, lowerf 4765.625000 < freq -15.625000 > upperf 4218.750000.
    INFO: Users/Amrit/workspace/sphinxbase/src/libsphinxbase/util/cmd_ln.c(691): Parsing command line:

    Can anyone tell me the reason for filterbank not to be created?

     
  • Can anyone tell me the reason for filterbank not to be created?

    Sure, ask the question on forum and you will get an answer.