Develop an English speech application on the. NET platform

Source: Internet
Author: User
Program Demo: Click to download
Source File: Click to download

1. First install Kingsoft
Then, the vtxtauto. TLB file will be found in speech under the system directory [Win2000 is the WINNT directory ].

2,Import COM objects to. net
We can use tlbimp.exe, a powerful tool provided by. Net framework, to import the COM Object of sapi sdk to. net. Tlbimp.exe generates a controlled packaging class, which can be used by the management client. Number of reference packages for managing the actual COM object. When the packaging class is used as the collection garbage, the packaging class releases the COM object it wraps. Finished.
C: \ winnt \ speech> tlbimp vtxtauto. TLB/namespace: dotnetspeech_e/out: dotnetspeech_e.dll

3. Use C # To develop an English TTS application example
The following example shows how to use C # To develop an English speech application. The development environment is:
Win2k + SP4 +. NET Framework V1.1 + Microsoft Visual Studio. NET 2003

First, create a C # windows application project speechapp [En] and add the dotnetspeech_e Object Library in Solution Explorer on the right of the development environment. Right-click "Reference" and choose "add reference". In the displayed dialog box, find the generated dotnetspeech_e.dll.

Now we can start writing applications.Code. This example shows how to read the English text in a speaker.
Program Interface

///

/// Read aloud
///

//////Private void buttonsynthesis_click (Object sender, system. eventargs E)
{
Try
{
If (this. textbox1.text. Trim ()! = "")
{
Dotnetspeech_e.ivtxtauto ivta = new dotnetspeech_e.vtxtautoclass ();
Ivta. Register ("","");
Ivta. Speak (this. textbox1.text, 0 );
}
}
Catch (system. Exception EC)
{
MessageBox. Show (EC. tostring (), "speechapp", messageboxbuttons. OK, system. Windows. Forms. messageboxicon. Error );
}
}

4,Conclusion
The. NET environment makes this development more convenient and convenient. Hurry up and test your application. Let's go !!!

Source: http://www.lionsky.net/MyWebsite/article/list.aspx? Id = 439

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.