Arnon Ilani - 2018-08-06

Hi,

Trying to detect speech on Androd device using processRaw.

I have the following config setup:

en-us.lm.bin language model
en-us-ptm acoustic model
cmudict-en-us.dict dictionary
also setting remove_noise to True and samprate to 8000

I want to do a Ngram Search.

Currenly my loop looks like:

        Decoder decoder = recognizer.getDecoder();
        int chunk_size = 1024;
        int index_start = 0;
        int index_finish = index_start+chunk_size-1;
        boolean doit = true;

        decoder.startUtt();

        while (doit)
        {
            short[] slice = Arrays.copyOfRange(audioBuffer, index_start, index_finish);
            int processRawRes = decoder.processRaw((slice), slice.length, false, false);

            index_start = index_finish;
            index_finish = index_start+chunk_size-1;

            if (index_finish>audioBuffer.length-1)
            {
                doit = false;

            }
        }// while (doit)

        decoder.endUtt();

When to call getInSpeech() ? and what is the optimal slice/chunk to use for processRaw?
Thanks.