Menu

Android PocketSphinx -16kHz

Help
KahZheng
2014-11-25
2014-11-27
  • KahZheng

    KahZheng - 2014-11-25

    Hi all,

    I've made an Android apps with the latest pocketsphinx-5prealpha library, which worked well.
    Now i need to use a new 16kHz acoustic model (which i tested with sphinx4 on window, and it works perfectly too) on the apps, but it doesn't recognize at all.

    I supposed the problem came from 8kHz recording of Android.
    How can i force Android to record at 16kHz?
    Or am i using the wrong pocketsphinx library?

    Please help thanks!

     
    • Nickolay V. Shmyrev

      You need to provide more information on the models you are using to get help on this issue and you need to share the raw files from android to get an answer on this.

      The most probable reason is that you can not use sphinx4 model for android, due to the limited resources android application requires another model which is not supported by sphinx4.

       
      • KahZheng

        KahZheng - 2014-11-26

        1. Android 16kHz
        For android code, I'm now simply using the android studio demo given to get things done
        https://sourceforge.net/projects/cmusphinx/files/pocketsphinx/5prealpha/

            File modelsDir = new File(assetsDir, "models");
            recognizer = defaultSetup()
                    .setAcousticModel(new File(modelsDir, "hmm/en-us-semi"))
                    .setDictionary(new File(modelsDir, "dict/cmu07a.dic"))
                    .setRawLogDir(assetsDir).setKeywordThreshold(1e-20f)
                    .getRecognizer();
            recognizer.addListener(this);
        
            // Create keyword search.
            File keywordFile = new File(KWS_FILE);
            recognizer.addKeywordSearch(KWS_SEARCH, keywordFile);
        
        
        }
        

        Is it possible to make the recognizer to use 16kHz AudioRecord??
        Or I need to use pocketsphinx 0.8 to get things done??

        2. Acoustic Model
        The model is actually trained by 3rd party, and I'm totally new to model training.
        What info do you need so u can help me with??

        What i'm given is as below:
        - a language model
        - a dict
        - acoustic model:
                  mdef
                  means
                  mixture weights
                  transition matrices
                  variances
                  mass.filler
                  feat.params

         

        Last edit: KahZheng 2014-11-26
        • Nickolay V. Shmyrev

          Recognizer already uses 16khz recording.

          The model is actually trained by 3rd party, and I'm totally new to model training. What info do you need so u can help me with??

          This looks like a continuous model, you need to have semi-continuous model for android. Continuous model is too slow. Or you can only recognize a simple grammar.

           
          • Nickolay V. Shmyrev

            What info do you need so u can help me with??

            The model, the full source code of your application, raw files collected on device during recognition attempts.

             
            • KahZheng

              KahZheng - 2014-11-27

              Thanks for the help Nikolay!

              The apps is finally able to recognize simple grammar using the model by simply emptying the feat.params file given by them. Thou the accuracy is slightly lower compared to desktop version.

               
  • Balakrishnan

    Balakrishnan - 2017-02-21

    I am trying to implement the voice to text convertion using pocketSphinx and I want the recorded audio to process further. Is there any option to set the audio format as wave or mp3 like that, as of now it is giving as Raw audio file else is there any way to convert the raw audio to specific format.

    Thanks in advance.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.