Export (0) Print
Expand All

SpeechHypothesizedEventArgs Class

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Provides data for the SpeechHypothesized event.


Namespace:  Microsoft.Speech.Recognition
Assembly:  Microsoft.Speech (in Microsoft.Speech.dll)

public class SpeechHypothesizedEventArgs : RecognitionEventArgs

An instance of SpeechHypothesizedEventArgs is created when the SpeechRecognitionEngine object raises the SpeechHypothesized event. To obtain detailed information about a tentatively recognized phrase, access the Result property in the handler for the event.

Numerous SpeechHypothesized events are generated as a recognition engine attempts to identify an input phrase. Typically, handling these events is only useful for debugging.

SpeechHypothesizedEventArgs derives from RecognitionEventArgs.

In the example below, a delegate is defined to use the instance of SpeechHypothesizedEventArgs passed to the handler for SpeechHypothesized events to display information about a tentatively recognized phrase.

// Create a handler for the SpeechHypothesized event.
recognizer.SpeechHypothesized += new EventHandler<SpeechHypothesizedEventArgs>(recognizer_SpeechHypothesized);

// Handle the event and display the hypothesized result.
void recognizer_SpeechHypothesized (object sender, SpeechHypothesizedEventArgs e)
    Console.WriteLine("Hypothesized text: " + e.Result.Text);

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2014 Microsoft