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
I appreciate it
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