这是我尝试运行时不断出现的错误消息: 错误: 我为此进行了高低搜寻,但似乎找不到答案! 语音识别属性中有两个语言选项: 适用于Windows的Microsoft Speech Recognizer 8.0(英语-英国) 适用于Windows的Microso ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我的表格:
此行错误:
REC.LoadGrammar(New Grammar(VOCABULARIO))
???????
谢谢。
Imports System.Speech.Recognition
Imports System.Threading
Imports System.Globalization
Public Class Form1
Dim REC As New SpeechRecognitionEngine
Dim PALABRA As String
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Thread.CurrentThread.CurrentCulture = New CultureInfo("pt-BR")
REC.RequestRecognizerUpdate()
REC.SetInputToDefaultAudioDevice()
Dim VOCABULARIO As New GrammarBuilder
VOCABULARIO.Append(New Choices("cc", "web", "word", "paint"))
REC.LoadGrammar(New Grammar(VOCABULARIO))
REC.RecognizeAsync(RecognizeMode.Multiple)
AddHandler REC.SpeechRecognized, AddressOf RECONOCE
AddHandler REC.SpeechRecognitionRejected, AddressOf NORECONOCE
End Sub
Public Sub RECONOCE(ByVal sender As Object, ByVal e As SpeechRecognizedEventArgs)
Dim RESULTADO As RecognitionResult = e.Result
Label1.Text = RESULTADO.Text.ToUpper
Dim PROCESO As New Process
Select Case RESULTADO.Text
Case "cc"
PROCESO.StartInfo.FileName = "C:\Program Files (x86)\Adobe\Adobe Dreamweaver CC 2014\Dreamweaver.exe"
PROCESO.Start()
Case "web"
PROCESO.StartInfo.FileName = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
PROCESO.Start()
Case "word"
PROCESO.StartInfo.FileName = "C:\Program Files\Windows NT\Accessories\wordpad.exe"
PROCESO.Start()
Case "paint"
PROCESO.StartInfo.FileName = "C:\Windows\System32/mspaint.exe"
PROCESO.Start()
End Select
End Sub
Public Sub NORECONOCE()
Label1.Text = "Repita, por favor!"
End Sub
End Class
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.