Use C # To write an Automatic Speech reading Robot

Source: Internet
Author: User
Tags sapi
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.