Afternoon all,
I've just started playing with SAPI - i've got the text to wav working fine however I'm trying to get a wav to text converter written also. I've got a problem whereby the recognition event isnt fired in the code below:
wavfile = "c:/ccs_audio/111.wav";
wavrecocontext = new SpeechLib.SpInProcRecoContext();
((SpInProcRecoContext)wavrecocontext).Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(wavrecocontext_Recognition);
((SpInProcRecoContext)wavrecocontext).EndStream += new _ISpeechRecoContextEvents_EndStreamEventHandler(wavrecocontext_EndStream);
grammar = wavrecocontext.CreateGrammar(2);
grammar.DictationLoad("", SpeechLoadOption.SLOStatic);
inputwav = new SpFileStream();
inputwav.Open(@wavfile, SpeechStreamFileMode.SSFMOpenForRead, false);
wavrecocontext.Recognizer.AudioInputStream = inputwav;
grammar.DictationSetState(SpeechRuleState.SGDSActive);
Any thoughts?
I've just started playing with SAPI - i've got the text to wav working fine however I'm trying to get a wav to text converter written also. I've got a problem whereby the recognition event isnt fired in the code below:
wavfile = "c:/ccs_audio/111.wav";
wavrecocontext = new SpeechLib.SpInProcRecoContext();
((SpInProcRecoContext)wavrecocontext).Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(wavrecocontext_Recognition);
((SpInProcRecoContext)wavrecocontext).EndStream += new _ISpeechRecoContextEvents_EndStreamEventHandler(wavrecocontext_EndStream);
grammar = wavrecocontext.CreateGrammar(2);
grammar.DictationLoad("", SpeechLoadOption.SLOStatic);
inputwav = new SpFileStream();
inputwav.Open(@wavfile, SpeechStreamFileMode.SSFMOpenForRead, false);
wavrecocontext.Recognizer.AudioInputStream = inputwav;
grammar.DictationSetState(SpeechRuleState.SGDSActive);
Any thoughts?