Text-to-speech implementation with TTS

Source: Internet
Author: User

Recently abused by the TOEFL Word dog:: >_<::

Want to do a software that can automatically turn the word into speech, so that you can wear headphones on the road while walking and listening ~

Using Microsoft's TTS Voice library can be easily implemented. Early TTS would be a hassle to read in both English and Chinese, but the new SDK from WIN10 has solved the problem. Chinese and English are automatically recognized. This is amazing ~

Note: If you are using the English version of the system, you need to install the Chinese speech Library first

You can then see this new voice library in the Control Panel-Speech recognition option:

Enter VS, Create a new C # project, and then right-click on the solution Explorer----References and add References, adding the following options:

There are two kinds of library,system.speech or speechlib for text to speech. I used the speechlib here.

The basic reading function is implemented as follows:

New SpVoice ();             0 // Speaking speed, [ -10,10]  - // volume, [0,100]voice. Voice = Voice. Getvoices (). Item (2// Audio Library voice . Speak (" Chinese speech");

But in order to play on the phone, just let it read out is not enough .... Best to save to an audio file

can be used Speechlib class: Speechlib.spfilestream sfs=new Speechlib.spfilestream ();

Homemade A little demo:

Click Select File to open the TXT file by opening the dialog box

Click Read to automatically turn text to speech and save to D:\233.mp3 file "Don't bother to write save dialog box

Download

Text-to-speech implementation with TTS

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.