How to recognize text with SAPI?
How can I开发者_JAVA百科 recognize text with SAPI, using C#?
Where can I find sample code?
Use the System.Speech.Recognition namespace. There's little point in battling the SAPI COM interfaces yourself, the SpeechRecognizer class lets you do anything you can do in SAPI. Point your browser to the MSDN Library topics for that namespace, you'll find plenty of examples.
they only thing I couldn't get system speech to do was to switch on/off a shared recognizer you can only get the state although in SAPI you can do this as the property isn't read only.
To get around this I use both SAPI (SpeechLib) and System.Speech.Recognition together. I noticed the shared recognizer follows the singleton design pattern which means that if it's already open you get a reference to the existing SAPI instance back rather then creating a new one.
This means that I could have a reference SAPI though the system.speech.recognition library and SpeechLib.dll.
(You get the best of both)
Kiran ;)
精彩评论