I am currently using the Microsoft.Speech API to dictate utterances into text, but what I really need is the alternative dictations the program could use. I am using this for my
This MSDN page handles what you're asking quite nicely. For reference, I'll post the included code. The final for loop is what contains the
// Handle the SpeechRecognized event.
void SpeechRecognizedHandler(object sender, SpeechRecognizedEventArgs e)
{
//... Code handling the result
// Display the recognition alternates for the result.
foreach (RecognizedPhrase phrase in e.Result.Alternates)
{
Console.WriteLine(" alt({0}) {1}", phrase.Confidence, phrase.Text);
}
}
The use of e.Result.Alternates
is the official way to obtain other possible words.
If that isn't giving you enough results, this MSDN page gives you the required information. You need to use UpdateRecognizerSetting
on your SpeechRecognitionEngine
to change the confidence rejection level. Setting it to 0 will make every single result display in Alternates
along with the confidence levels, which you can sort to obtain the top 10.