title: Speech To text In Visual Basic
body: <p>I have the code for speech to text written in Visual Basic, but it recognizes only first word or sentence spoken, then it stops recognizing. I want it to keep listening. How can I do that? What is the problem?
  Here's the code I have for now:</p>
  
  <pre><code>Imports System.Speech
  
  Public Class Form1
  
      Public synth As New Speech.Synthesis.SpeechSynthesizer
      Public WithEvents recognizer As New Speech.Recognition.SpeechRecognitionEngine
      Dim gram As New System.Speech.Recognition.DictationGrammar()
  
      Public Sub GotSpeech(ByVal sender As Object, ByVal phrase As System.Speech.Recognition.SpeechRecognizedEventArgs) Handles recognizer.SpeechRecognized
          words.Text += phrase.Result.Text &amp; vbNewLine
      End Sub
  
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          recognizer.LoadGrammar(gram)
          recognizer.SetInputToDefaultAudioDevice()
          recognizer.RecognizeAsync()
      End Sub
  End Class
  </code></pre>