. NET platform to develop the English voice application

Source: Internet
Author: User
Tags garbage collection wrapper visual studio
Program 1, first install PowerWord
vtxtauto.tlb files are then found in the system directory [Win2000 is winnt directory] speech

2, import COM objects to. Net
We can take advantage of the powerful tool TlbImp.exe from the. NET Framework to import the SAPI SDK's COM objects into. Net. TlbImp.exe produces a regulated wrapper class that the admin client can use. The wrapper class manages the reference number of the actual COM object. When the wrapper class is treated as garbage collection, the wrapper class releases the COM object it wraps. Of course, you can also implement COM objects by selecting COM objects from the Project Reference dialog box in the Vs.net environment, which is also done through TlbImp.exe.
C:\winnt\speech>tlbimp Vtxtauto.tlb/namespace:dotnetspeech_e/out:dotnetspeech_e.dll

3. Using C # to develop an English TTS application sample
The following is an example of how to use C # to develop an English voice application, the development environment is:
Win2k+sp4+.net Framework v1.1+microsoft Visual Studio. Net 2003

First, create a new C # Windows application Engineering Speechapp[en] and add Dotnetspeech_e object libraries to the solution Manager (Solution Explorer) on the right side of the development environment. Right-click on "Reference" (Reference), select "Add Reference" (add Reference), in the Pop-up File selection dialog box to find just the generated dotnetspeech_e.dll.


Here we can start writing the application code. This example shows how to read English text aloud through the horn.
Program interface as shown:


///
Read
///
///
///
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 easier and faster. Go to the test and get your app "Vivid", embodying the nature ui,let ' s goes!!!



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.