2

I am using the code written here to try the speech recognition in android. I've hooked the speech recognizer to a button, but when I press the button, I immediate get an error (2). The error code 2 corresponds with "ERROR_NETWORK", though I'm connected well. After it errors, it continues again (I hear the prompt through the speakers) and then I log the RMS change. I see a constant -2.12 being logged and does not change with the volume of my voice.

  1. I Press the button to begin speech rec
  2. I see the RMS being logged, but it only returns 2.12
  3. I get an error after about 100ms that corresponds with ERROR_NETWORK
  4. I continue seeing RMS being logged at 2.12
  5. Speech rec never finishes.

Here is how I start the code listed in the link above:

    promptSpeechInput.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if(mIslistening) {
                mIslistening = false;
                mSpeechRecognizer.destroy();
            } else {
                mIslistening = true;
                mSpeechRecognizer.startListening(mSpeechRecognizerIntent);
            }
        }
    });
Community
  • 1
  • 1
ntgCleaner
  • 5,865
  • 9
  • 48
  • 86

0 Answers0