Put the address of an instance first Https://github.com/wenco/speech
Jquery.speech is an extension that is written in jquery, mainly for voice broadcast.
Interface calls Baidu translation interface, so there is a URL parameter length problem. The Baidu interface itself also does not allow long text calls, only short texts call.
Initial parameters in detail: "Speech": true,//by clicking on the link to broadcast, or directly broadcast "Lang": "en",//language
"Speed": 3,//rate
"Swidth": 16,//width of the link button
"Sheight": 13,//height of the link button
"BG": "./image/speech.png",//background picture of the link button
"Content": "This is a test contents"//Direct Broadcast content
Specific code:
<DivID= "Result">Tell kite what to eat.</Div><Scriptsrc= "Js/jquery/jquery-2.1.4.min.js"></Script><Scriptsrc= "Js/speech/jquery.speech.min.js"></Script><Script> $('#Result'). Speech ({"speech": true, " Speed": 1, "BG": "./images/speech.png" });</Script>
And then it's done!
Jquery.speech realization of text to speech broadcast function