1

I made a speech recogntion application but when I try to run it I got this erre

Object reference not set to an instance of an object.

 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
Ahmed Nezar
  • 69
  • 1
  • 1
  • 8

0 Answers0