HighTechTalks DotNet Forums  

VB.net Voice Recognition???

Dotnet Framework microsoft.public.dotnet.framework


Discuss VB.net Voice Recognition??? in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Slickuser
 
Posts: n/a

Default VB.net Voice Recognition??? - 11-28-2007 , 02:29 AM






I am running Windows XP Pro SP 2, have Office 2003, installed SDK 5.1,
Visual Studio 2005 with installed .NET Frame 3.0 (re-distribution package).

System.Speech is in .NET 3.0.

C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0

It doesn't contain:
Recognition.DesktopRecognizer
GrammarBuilding.SrgsDocument
GrammarBuilding.SrgsRule
GrammarBuilding.SrgsOneOf

I look at .NET 3.0, they have System.Speech.Recognition.SrgsGrammar.SrgsRule
So my best guess that the namespace/class is a little different?


source link:
http://blogs.msdn.com/robertbrown/ar...14/428967.aspx

////////////////code

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

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.