dcsimg
October 21, 2018
Hot Topics:

Beginning MS Agent: Part 3

  • November 20, 2002
  • By Mack Male
  • Send Email »
  • More Articles »

What if you have lots of commands with voice input commands that are very similar? Well there is a way to only call a command if the agent clearly recognizes the spoken input. Consider our code from above, modified.

Private Sub Agent1_Command(ByVal UserInput as Object) Dim BadConfidence BadConfidence = 10  If (UserInput.Confidence <= -40) Then    ' Bad Recognition    Exit Sub  ElseIf (UserInput.Alt1Name <> "") And _         Abs(Abs(UserInput.Alt1Confidence) - _           Abs(UserInput.Confidence)) _            < BadConfidence Then    ' Bad Confidence - too close to another command    Exit Sub  ElseIf (UserInput.Alt2Name <> "") And _        Abs(Abs(UserInput.Alt2Confidence) - _          Abs(UserInput.Confidence)) _           < BadConfidence Then    ' Bad Confidence - too close to another command    Exit Sub  Else ' High Confidence      Select Case UserInput.Name        Case "ACO"            Agent1.PropertySheet.Visible = True    End Select  End IfEnd Sub

First of all, many thanks to the MASH program, which is where I first learned of this code example. For a more detailed description of this code, please visit the MASH site. Basically what we have done above is define how exact the spoken input needs to be in order to call the command. You can alter the numbers to adjust how sensitive the speech must be. A BadConfidence number of about 10 is a good starting number to limit the speech recognition engine's mistakes.



Page 4 of 6



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date