First, the HTML5 voice broadcast example, the specific explanation please consult the relevant documents:
HTML5 Voice broadcast function speak (Texttospeak) {//Create an instance of speechsynthesisutterance var utterance = new Speechsynthesisutter Ance (); Set text Utterance.text = Texttospeak; Added Chinese support Utterance.lang = ' ZH-CN '; Utterance.rate = 0.5; Add to Queue window.speechSynthesis.speak (utterance);}
The following is a description of the different ways to implement the voice broadcast feature and the problems encountered:
One, online TTS voice reading function realization:
1, if you do Internet Web site or application, you can use the online Tts,webspeech is a web developer-oriented JavaScript library, reference address: Http://www.eguidedog.net/cn/WebSpeech_ cn.php, note: The library can only be used in the case of networking;
Second, online & offline voice reading implementation (requires client TTS engine support):
1, Window TTS engine extension method: First we want to be clear that the full Windows 7 Chinese, Windows 2008 Chinese system comes with the TTS Chinese engine for Microsoft Lili, and Windows 8 Chinese, Windows 2012 The Chinese version comes with a TTS engine for Microsoft Huihui Desktop (It is important to note that some lite systems have some system files that may be castrated, causing the TTS engine to not work properly, and then need to expand the voice packet);
2, take window7 system for example, need to install TTS voice engine repair patch,: Http://pan.baidu.com/s/1i4krheH, installation Step reference: Http://www.443w.com/tts/?post=3, after the normal installation, Turn on the computer-control panel: Viewed as a small icon, you will find a more "voice" setting, as shown in:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/88/E7/wKioL1gAWNTyXaUMAAAqUuXQraE001.png-wh_500x0-wm_3 -wmp_4-s_2996846623.png "title=" Qq20161014120159.png "alt=" Wkiol1gawntyxaumaaaquuxqrae001.png-wh_50 "/>
Click Open, you may see a warning message, ignore it, then the Voice Properties dialog box appears, select the text-to-Speech tab: Select the voice you want to broadcast in the page, and then apply it.
Additional Chinese Voice pack download path: http://www.ew8.cn/Html/service/documents/2012/10/16/522.html
This article is from the "Pig Flying" blog, please be sure to keep this source http://jiyanle.blog.51cto.com/6932197/1861847
HTML5 Voice broadcast: About TTS engine extensions and remediation considerations