This topic has not yet been rated - Rate this topic

RecognizeCompletedEventArgs Class

Returns data from the RecognizeCompleted event.

Namespace:  System.Speech.Recognition
Assembly:  System.Speech (in System.Speech.dll)
public class RecognizeCompletedEventArgs : AsyncCompletedEventArgs

The RecognizeCompleted event is raised by the SpeechRecognizer and SpeechRecognitionEngine classes.

RecognizeCompletedEventArgs derives from [System.EventArgs] and is generated upon completion of recognition operations initiated by calls to the RecognizeAsync overloads on an instance of SpeechRecognitionEngine.

The example below show a simple [anonymous][method] used as the handler for RecognizeCompleted. The handler stores the result of the recognition operation, if Result is not null and updates a state variable. If an error condition exists, a message is sent to the end user.


_recognizer.RecognizeCompleted += delegate(object sender, RecognizeCompletedEventArgs completedEventArgs) {
    _recognitionDone = true;
    if (completedEventArgs.Result != null) {
        _completedEventArgs = completedEventArgs;
        _recognitionSuccess = true;
    } else {
        _completedEventArgs = null;
        _recognitionSuccess = false;
        MessageBox.Show(String.Format("Recognition failed\n",
                                      "InitialSilenceTimeout: {0}\n",
                                      "BabbleTimeout: {0}\n",
                                      "InputStreamEnded: {2}\n",
                                      completedEventArgs.InitialSilenceTimeout,
                                      completedEventArgs.BabbleTimeout,
                                      completedEventArgs.InputStreamEnded));
    }
};
System.Object
  System.EventArgs
    System.ComponentModel.AsyncCompletedEventArgs
      System.Speech.Recognition.RecognizeCompletedEventArgs
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ