Okay, So I got the WithEvents down, but now it won't recognize anything I say. It just stops and never triggers the gotspeech sub. Can anyone help?
Code:Imports System.Speech Public Class Form1 Public synth As New Speech.Synthesis.SpeechSynthesizer Public WithEvents recognizer As New Speech.Recognition.SpeechRecognitionEngine Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click synth.Speak("This is a test.") End Sub Public Sub GotSpeech(ByVal sender As Object, ByVal phrase As System.Speech.Recognition.SpeechRecognizedEventArgs) Handles recognizer.SpeechRecognized words.Text += phrase.Result.Text & "\n" End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load recognizer.SetInputToDefaultAudioDevice() recognizer.Recognize() End Sub End Class




Reply With Quote