SpeechRecognitionResult.GetAlternates(int) method
The GetAlternates(int) method returns the list of alternate interpretations of a speech recognition attempt.
maxAlternates
Type: System.Int
The maximum number of alternates to return.
Type: System.Collections.Generic.IReadOnlyList<Bing.Speech.SpeechRecognitionResult>
A list of up to maxAlternates alternate speech recognition results.
When a SpeechRecognizer finishes analyzing a speech session, it creates an IReadOnlyList of possible interpretations as SpeechRecognitionResult objects and ranks them in order of confidence. The SpeechRecognitionResult object with the highest TextConfidence value is ranked as item [0] in the list and is returned by the SpeechRecognizer.RecognizeSpeechToTextAsync() method. The GetAlternates(int) method gets the list of these alternate results.
In cases where no interpretation meets the minimum confidence threshold, the list of alternates will consist of a single SpeechRecognitionResult object with a Text value of null and a TextConfidence value of SpeechRecognitionConfidence.Rejected.
Invoking the GetAlternates(int) method on a primary SpeechRecognitionResult object or any member of the associated list of alternates will return the same result.
Example
The following example gets the alternates from a SpeechRecognitionResult, and then writes the Text and TextConfidence values to a drop down list named ResultChooser.
Requirements
Minimum Supported Client | Windows 8 |
Required Extensions | Bing.Speech |
Namespace |