

Gets the format of the audio being received by the SpeechRecognitionEngine.

Initializes a new instance of the SpeechRecognitionEngine class with a string parameter that specifies the name of the recognizer to use. Initializes a new instance of the SpeechRecognitionEngine using the information in a RecognizerInfo object to specify the recognizer to use. Initializes a new instance of the SpeechRecognitionEngine class using the default speech recognizer for a specified locale. Initializes a new instance of the SpeechRecognitionEngine class using the default speech recognizer for the system. Otherwise, the resources it is using will not be freed until the garbage collector calls the recognizer object's Finalize method. By contrast, the SpeechRecognizer shares a single recognizer with any application that wants to use it.Īlways call Dispose before you release your last reference to the speech recognizer. The SpeechRecognitionEngine object is for the sole use of the process that instantiated the object. To emulate input to the recognizer, use the EmulateRecognize and EmulateRecognizeAsync methods.

The recognizer uses more than one thread to perform tasks. To synchronize changes to the recognizer, use the RequestRecognizerUpdate method. The recognizer returns recognition results in a RecognitionResult object. To change the number of alternates the recognizer returns, use the MaxAlternates property. To modify how recognition handles silence or unexpected input, use the BabbleTimeout, InitialSilenceTimeout, EndSilenceTimeout, and EndSilenceTimeoutAmbiguous properties. To perform speech recognition, use the Recognize or RecognizeAsync method. To configure the input to the recognizer, use the SetInputToAudioStream, SetInputToDefaultAudioDevice, SetInputToNull, SetInputToWaveFile, or SetInputToWaveStream method. To manage speech recognition grammars, use the LoadGrammar, LoadGrammarAsync, UnloadGrammar, and UnloadAllGrammars methods, and the Grammars property. To create an in-process speech recognizer, use one of the SpeechRecognitionEngine constructors. This class is for running speech recognition engines in-process, and provides control over various aspects of speech recognition, as follows: To get information about which recognizers are installed, use the static InstalledRecognizers method. You can create an instance of this class for any of the installed speech recognizers. Static void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)Ĭonsole.WriteLine("Recognized text: " + e.Result.Text) Recognizer.RecognizeAsync(RecognizeMode.Multiple) Start asynchronous, continuous speech recognition. Recognizer.SetInputToDefaultAudioDevice() Configure input to the speech recognizer. New EventHandler(recognizer_SpeechRecognized) Add a handler for the speech recognized event. Recognizer.LoadGrammar(new DictationGrammar()) Create an in-process speech recognizer for the en-US locale. Because this example uses the Multiple mode of the RecognizeAsync method, it performs recognition until you close the console window or stop debugging. The following example shows part of a console application that demonstrates basic speech recognition.
