Use C # To write an Automatic Speech reading Robot
Before the introduction first recommended a very good site, http://www.openso.net/
Before development, you need to download two Development SDK package and Language Pack,: http://www.openso.net/querytool? Index = 1 & amp; amp;word;install speechsdk51.exe,speechsdk51langpack.exe, here is a development help documentation, download address: http://www.openso.net/queryebook? Index = 1 & word =.
Sapi sdk is a free speech application development kit provided by Microsoft. It contains the speech application design interface (SAPI) and Microsoft's continuous speech recognition engine (MCSR) and Microsoft's speech synthesis (TTS) engine. The current version 5.1 supports recognition in three languages (English, Chinese and Japanese) and synthesis in two languages (English and Chinese ). SAPI also includes direct speech management, training wizard, events, syntax compilation, resources, and speech recognition (SR) for low-level control and high adaptability) management, TTS management, and other powerful design interfaces.
1. First, use the tlbimp tool to convert the type definitions in the com Type Library to the Common Language Runtime Library.ProgramCentralized equivalent definition.
The command is as follows:
Cd c: \ Program Files \ common files \ microsoft shared \ speech \
Tlbimp SAPI. dll/out: dotnetspeech. dll
Finally, use the ildasm tool to view the generated dotnetspeech. dll component.
Note: Some exceptions may occur during the process, but it does not matter.
2. Create a WIN project, import components to the project by referencing them, and write the following code.
Speechvoicespeakflags spflags = speechvoicespeakflags. svsflagsasync;
Spvoice v = new spvoice ();
V.speak(this.txt content. Text, spflags );
3. finally run the program, as shown in: