Day Vision

Reading Everyday,Extending Vision

JavaScript, js voice broadcast script, Google Chrome voice broadcast

2023-02-28 04:12:49


The default value is 1utterthis. exe. Rate = 1;//speech rate, numeric value, default value is 1, range is 0.1 to 10utterthis. Volume = 100;//volume of sound window. Speech synthesis. Speak


1、JavaScript,js语音播报脚本

The first time you open the browser will not automatically broadcast, you need to manually click on the broadcast page, so that the current page to get the cursor

/* * Param Str { broadcast text } */function speckText (str){ let utterThis = new window. Speech synthesis tterance () ; utterthis. Text = Str;//play the content utterthis. Pitch = 2;//indicates the pitch of the speech, a number that ranges from 0(minimum) to 2(maximum) . The default value is 1utterthis. exe. Rate = 1;//speech rate, numeric value, default value is 1, range is 0.1 to 10utterthis. Volume = 100;//volume of sound window. Speech synthesis. Speak (utterThis) ;//console. Log (“Playback:” STR) ; } specktext (“New orders coming in!”) ;