问题
I'm trying to find a way to get the SpeechRecognizer to react to speech a lot quicker. I have found that the process from onBeginning of speech onwards is pretty fast, but I need the actual reaction to speech meaning onBeginning of speech to have a timelimit before deciding what word is said. Let me know possible suggestions.
回答1:
Your question isnt very clear but if you want more fine-grained control over when speech should start recording or the minimum length of the speech etc. you can set quite a few extras in the RecognizerIntent
to customize it to your needs such as
EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS
, EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS
and EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS
.
Read up on these here.
来源:https://stackoverflow.com/questions/16432585/voicerecognition-android-taking-too-long-to-react