raghuk996
Lurker
Hi there,
I am using google voice-to-text ,when i click on microphone and speak and stop for 1 second it is automatically closing.I have tried using the below code,but it is only silencing before starting anyone speaking,but i also what the microphone to listen after speaking for some seconds.can anyone please help me.
source code:
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS,300000);
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS,300000); intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS,300000); // Start the activity, the intent will be populated with the speech text intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"in.concent.healphaTest"); startActivityForResult(intent, SPEECH_REQUEST_CODE);
I am using google voice-to-text ,when i click on microphone and speak and stop for 1 second it is automatically closing.I have tried using the below code,but it is only silencing before starting anyone speaking,but i also what the microphone to listen after speaking for some seconds.can anyone please help me.
source code:
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS,300000);
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS,300000); intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS,300000); // Start the activity, the intent will be populated with the speech text intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"in.concent.healphaTest"); startActivityForResult(intent, SPEECH_REQUEST_CODE);