Redigera

Dela via


Set speech recognition timeouts

Set how long a speech recognizer ignores silence or unrecognizable sounds (babble) and continues listening for speech input.

Important APIs: Timeouts, SpeechRecognizerTimeouts

Set a timeout

Here, we specify various Timeouts values:

  • InitialSilenceTimeout - The length of time that a SpeechRecognizer detects silence (before any recognition results have been generated) and assumes speech input is not forthcoming.
  • BabbleTimeout - The length of time that a SpeechRecognizer continues to listen to unrecognizable sounds (babble) before it assumes speech input has ended and finalizes the recognition operation.
  • EndSilenceTimeout - The length of time that a SpeechRecognizer detects silence (after recognition results have been generated) and assumes speech input has ended.

Note  Timeouts can be set on a per-recognizer basis.

 

// Set timeout settings.
recognizer.Timeouts.InitialSilenceTimeout = TimeSpan.FromSeconds(6.0);
recognizer.Timeouts.BabbleTimeout = TimeSpan.FromSeconds(4.0);
recognizer.Timeouts.EndSilenceTimeout = TimeSpan.FromSeconds(1.2);

Samples