Hi all,
just started working on .NET...:)
I was making a MDI app with vb.NET and SAPI
i used System.speech.recognition namespace
and SpeechRecognizer element..
working for single doc.. bt when i go for new form with same giving
An error occurred creating the form. See Exception.InnerException for details. The error is: Unable to cast COM object of type 'System.Speech.Internal.SapiInterop.SpSharedRecognizer' to interface type 'System.Speech.Internal.SapiInterop.ISpRecognizer'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{C2B5F241-DAA0-4507-9E16-5A1EAA2B7A5C}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
this error...
i would be glad if anyone can guide me with that...
the code i wrote is like this
Dim recognizer As SpeechRecognizer
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
Me.recognizer = New SpeechRecognizer
Me.speechEnable()
End Sub
Private Sub speechEnable()
Dim myGram As Grammar
myGram = New Grammar("D:\data\logTest.xml")
myGram.Enabled = True
recognizer.UnloadAllGrammars()
recognizer.LoadGrammar(myGram)
'attach the event handler
AddHandler recognizer.SpeechRecognized, AddressOf recognizer_SpeechRecognized
AddHandler recognizer.SpeechDetected, AddressOf recognizer_SpeechDetected
End Sub