| | |
| | | var to_speak = new SpeechSynthesisUtterance(txt);
|
| | | to_speak.voice = this.voice; // 设定中文播报
|
| | | to_speak.rate = this.rate;
|
| | | console.info(to_speak);
|
| | | //console.info(to_speak);
|
| | | this.speak.speak(to_speak);
|
| | |
|
| | | var starttime = new Date();
|
| | |
| | | if(callback && typeof callback == 'function'){
|
| | | var endtime = new Date();
|
| | | var timelong = (endtime.getTime()-starttime.getTime())/1000;
|
| | | console.info(parseInt(_timeInterval)+"==="+parseInt(timelong));
|
| | | //console.info(parseInt(_timeInterval)+"==="+parseInt(timelong));
|
| | | if(timelong > this.timeInterval){
|
| | | callback();
|
| | | }else{
|