我做了一个语音识别应用程序,但是当我尝试运行它时,我得到了这个错误
对象引用未设置为对象的实例。
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim gram As New Recognition.SrgsGrammar.SrgsDocument
Dim rule As New Recognition.SrgsGrammar.SrgsRule("command")
Dim commandList As New Recognition.SrgsGrammar.SrgsOneOf("Hello", "How are you", "I'm good to", "open google", "open facebook", "open twitter", "open youtube", "goto url", "run chrome", "run mozila", "run explorer", "open local d", "open local c", "run media player")
rule.Add(commandList)
gram.Rules.Add(rule)
gram.Root = rule
reco.LoadGrammar(New Recognition.Grammar(gram)) >> HERE
reco.RecognizeAsync()
End Sub