i am building an application which collects user data through speech recognition. My problem is that it only takes about 5 seconds before the speech timeout error is called which stops the speech recogniser from recognising any other voice. My question is: how do i increase the time for the timeout error or how do i stop the error.
My code:
SpeechRecogniser sr = createSpeechRecogniser(this)
recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE,"en");
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
sr.startListening(recogniserIntent);
sr.setOnRecognitionListener(new OnRecognitionListener(){
//implenent all its methods
onError(int code){
switch(code){
case ERROR_SPEECH_TIMEOUT:
//this is where the error is called and stops the speech recogniser
//i want the time for this error to be increased
break;
}
}
});