Question

I am trying to use Speech API 5.1 in command and control mode in a c# application. I am using it inProc and have only two commands in the grammer. The problem I am facing is related to the accuracy of detecting these commands. The recognition engine is not recognizing the commands properly. Sometimes (rather more than sometimes) it just gets activated with any voice (not any close to the sound of commands). Is there any technique to make it more strict in recognizing the only two commands I have?

Was it helpful?

Solution

You can check the result's Confidence property in your SpeechRecognized event.

void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
    if(e.Result.Confidence > THRESHOLD)
    {
       //matched
    }
    else
    {
       //not reliable enough, so consider it unmatched
    }
}

You can experiment with different values for THRESHOLD, between 0.0 and 1.0. The higher the threshold, the more "strict" it will be (although if you put it too high, you might start to lose recognition). Try starting around a THRESHOLD value of 0.7 and then adjust it from there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top