Groups > Microsoft > dotNET Speech SDK > Error: because they do not have the same signature.




Error: because they do not have the same signature.

Error: because they do not have the same signature.
Tue, 10 Apr 2007 08:33:38 -070
Hello,

 I am running Vista Business Enterprise. When I try and compile the code 
below I get the following error.

Method 'Private Sub reco_SpeechRecognized(sender As Object, e As 
System.Speech.Recognition.RecognitionEventArgs)' cannot handle Event 'Public 
Event SpeechRecognized(sender As Object, e As 
System.Speech.Recognition.SpeechRecognizedEventArgs)' because they do not 
have the same signature.

Is there something that I am missing on my system? Thanks in advance.

http://blogs.msdn.com/robertbrown/archive/2005/07/20/440983.aspx

Code:
Imports System.Speech.Recognition

Imports System.Speech.Synthesis

Public Class Form1

    Dim WithEvents reco As New SpeechRecognizer

    Dim WithEvents synth As New SpeechSynthesizer

    Private Sub btnReco_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles btnReco.Click

        Me.txtContent.Text = ""

        reco.LoadGrammar(New DictationGrammar())

        reco.SetInput(Me.txtPath.Text)

        reco.RecognizeAsync()

    End Sub

    Private Sub reco_SpeechRecognized(ByVal sender As Object, ByVal e As 
System.Speech.Recognition.RecognitionEventArgs) Handles 
reco.SpeechRecognized

        Me.txtContent.Text = "Recognized: " & e.Result.Text

    End Sub

    Private Sub btnSynth_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles btnSynth.Click

        synth.SetOutput(Me.txtPath.Text)

        synth.SpeakAsync(Me.txtContent.Text)

    End Sub

    Private Sub synth_SpeakCompleted(ByVal sender As Object, ByVal e As 
System.Speech.Synthesis.SpeakCompletedEventArgs) Handles 
synth.SpeakCompleted

        Me.txtContent.Text = "done!"

        synth.Dispose()

    End Sub


End Class
Post Reply
about | contact