Speech SDK

Speedular

New member
Joined
Dec 15, 2008
Messages
3
Programming Experience
Beginner
Hello Guys
I kinda need some help on an application I'm trying to develop in VB.NEt
u c I've Installed Speech SDK 5.1 and went to try off some tuts I found online ; and an error keeps on appearing under any speech related method such as "Recognition.DesktopRecognizer" on the third line of code; any advice?

and ya here is the code
VB.NET:
Imports System.Speech
Public Class Form1
   Dim WithEvents reco As New Recognition.DesktopRecognizer

   Private Sub SetColor(ByVal color As System.Drawing.Color)
      Dim synth As New Synthesis.SpeechSynthesizer
      synth.SpeakAsync("setting the back color to " + color.ToString)
      Me.BackColor = color
   End Sub

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Dim gram As New GrammarBuilding.SrgsDocument
      Dim colorRule As New GrammarBuilding.SrgsRule("color")
      Dim colorsList As New GrammarBuilding.SrgsOneOf("red", "green")
      colorRule.Add(colorsList)
      gram.Rules.Add(colorRule)
      gram.Root = colorRule
      reco.LoadGrammar(New Recognition.Grammar(gram))
   End Sub

   Private Sub reco_SpeechRecognized(ByVal sender As Object, ByVal e As System.Speech.Recognition.RecognitionEventArgs) Handles reco.SpeechRecognized
      Select Case e.Result.Text
         Case "red"
            SetColor(Color.Red)
         Case "green"
            SetColor(Color.Green)
      End Select
   End Sub
End Class

I appreciate it
 
You probably haven't added reference to the .Net 3.0 library System.Speech.dll. Also, DesktopRecognizer is not a known type, I saw it in a code comment for SpeechRecognizer Class in help, perhaps it was a beta version name and they changed it for release.
 
Back
Top