LiJun
2018-10-30 c2ed5f5cc531d6823b6d59ef03ee816c46876aeb
修复语音播报不能持续播报bug
1个文件已修改
10 ■■■■ 已修改文件
gx_tieta/WebRoot/js/VoiceUtil.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/js/VoiceUtil.js
@@ -15,7 +15,7 @@
        console.info('你的电脑不支持中文播报!');        
    }
    _timeInterval = this.timeInterval;
    //console.info(this.zh_CN);
    //console.info(this.speak_enable);
    if(!this.speak_enable){                                    //识别是否开启声音播报
        if(callback && typeof callback == 'function'){
            setTimeout(function(){
@@ -29,11 +29,11 @@
    to_speak.voice = this.voice;    // 设定中文播报
    to_speak.rate = this.rate;
    //console.info(to_speak);
    this.speak.speak(to_speak);
    var starttime = new Date();
    this.speak.speak(to_speak);
    console.info(to_speak);
    to_speak.onend = function(event) {    
        //console.info(event);
        //console.info("播放结束");
        if(callback && typeof callback == 'function'){
            var endtime = new Date();
            var timelong = (endtime.getTime()-starttime.getTime())/1000;
@@ -49,7 +49,7 @@
    };
    
    to_speak.onerror = function(event) {    
        //console.info(event);
        console.info(event);
    };
};