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.
- I Press the button to begin speech rec
- I see the RMS being logged, but it only returns 2.12
- I get an error after about 100ms that corresponds with ERROR_NETWORK
- I continue seeing RMS being logged at 2.12
- 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);
}
}
});