Implementation platform:
Microsoft Visual maxcompute 2005
Microsoft tts5.1 Speech Engine (Chinese)
Required items:
Click here to download dotnetspeech. dll (160 K) exported from sapi.51 SDK with tlbimp)
Microsoft tts5.1 Speech Engine (Chinese). MSI (1.55 m) and above are missing because of their size relationship, you can leave a mailbox address as needed. If you have installed the sapi.51 SDK, you can use this command to export dotnetspeech. dll.
Tlbimp SAPI. dll/out: dotnetspeech. dll)
Install Microsoft tts5.1 voice engine (Chinese ). msi, open "Control Panel", open "Voice" configuration item, select "Microsoft Simplified Chinese" in the "voice selection" combo box of "text-speech conversion ", in this way, Chinese characters can be read. To read English, select "Microsoft Sam ".
Use Microsoft Visual Studio 2005 to create a project, add references, and reference dotnetspeech. dll.
Namespace:
Using dotnetspeech;
Read Chinese characters in the text box:
Speechvoicespeakflags spflags = speechvoicespeakflags. svsflagsasync;
Spvoice voice = new spvoice ();
Voice. Speak (textbox1.text, spflags );
Save the Chinese pronunciation in the text box as a WAV file:
speechvoicespeakflags spflags = speechvoicespeakflags. svsflagsasync;
spvoice voice = new spvoice ();
savefiledialog dialog = new savefiledialog ();
dialog. filter = "all files (*. *) | *. * | WAV Files (*. wav) | *. wav ";
dialog. title = "Save WAV Files";
dialog. filterindex = 2;
dialog. restoredirectory = true;
If (dialog. showdialog () = dialogresult. OK)
{< br> speechstreamfilemode spfilemode = speechstreamfilemode. ssfmcreateforwrite;
spfilestream = new spfilestream ();
spfilestream. open (dialog. filename, spfilemode, false);
voice. audiooutputstream = spfilestream;
voice. speak (textbox1.text, spflags);
voice. waituntildone (1000);
the above two sentences must be written, otherwise the generated file has no sound
the smtimeout behind waituntildone is an int type
spfilestream. close ();