Realization of Dotnet Voice technology

Source: Internet
Author: User
Tags dotnet


Speech implementation

"Computer pronunciation" (English) a very good trigger point, through it can achieve electronic novel reading, English listening test, English word learning ...
The following speech has a simple encapsulation of the Mstts.

1. Install a good Mstts, you can hit the Vtxtauto.lib file in the Windows\speech

2. Convert Vtxtauto.tlb to a. dll format with the TlbImp tool with the. Net SDK:
TlbImp Vtxtauto.tlb/silent/namespace:mstts/out:mstts.dll
The Mstts.dll has become a class of the. NET Framework runtime.

3. Write a simple class that encapsulates the Vtxtauto: Speech.
========================speech.cs======================

Using System;
Using Mstts; Mstts name Space

Namespace bedlang{//define Namespaces

public class speech{

Private Vtxtauto Vtxtautoex;

Public Speech () {
Vtxtautoex = new Vtxtauto ();
Vtxtautoex.register ("", ""); Registering COM components
}

public void Speak (String text) {
Vtxtautoex.speak (text, 0); Pronunciation
}

}

}

========================speech.cs======================

4. Compile Bedlang.speech
Csc/target:library/out:bedlang.dll Speech.cs/r:mstts.dll

5. Pronunciation Realization
========================demo.cs======================
Using System;
Using System.Windows.Forms;
Using Bedlang; Reference namespace

public class Demo:form {

public static void Main () {
Application.Run (New demo ());
}

Public demo () {
Speech s = new Speech (); Create a Speech object
S.speak ("Bedlang"); Pronunciation
}

}
========================demo.cs======================

6. Compile Demo.cs
CSC Demo.cs/r:bedlang.dll

7. Run Demo.exe
Program pronunciation.




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.