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