.NET Framework SpeechRecognitionEngine class to recognize speech

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • SpeechRecognitionEngine()
  • SpeechRecognitionEngine.LoadGrammar(Grammar grammar)
  • SpeechRecognitionEngine.SetInputToDefaultAudioDevice()
  • SpeechRecognitionEngine.RecognizeAsync(RecognizeMode mode)
  • GrammarBuilder()
  • GrammarBuilder.Append(Choices choices)
  • Choices(params string[] choices)
  • Grammar(GrammarBuilder builder)

Parameters

LoadGrammar: ParametersDetails
grammarThe grammar to load. For example, a DictationGrammar object to allow free text dictation.
RecognizeAsync: ParametersDetails
modeThe RecognizeMode for the current recognition: Single for just one recognition, Multiple to allow multiple.
GrammarBuilder.Append: ParametersDetails
choicesAppends some choices to the grammar builder. This means that, when the user inputs speech, the recognizer can follow different "branches" from a grammar.
Choices constructor: ParametersDetails
choicesAn array of choices for the grammar builder. See GrammarBuilder.Append.
Grammar constructor: ParameterDetails
builderThe GrammarBuilder to construct a Grammar from.

Remarks

To use SpeechRecognitionEngine, your Windows version needs to have speech recognition enabled.

You have to add a reference to System.Speech.dll before you can use the speech classes.



Got any .NET Framework Question?