需要良好的性能文本到语音代码 [英] need good performance text to speech code

查看:60
本文介绍了需要良好的性能文本到语音代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我的HTML代码

我的问题是性能缓慢..当我点击播放它分析DB的整个内容然后它的阅读....我希望这个被逮捕..亲切指导我..





hi my html code
my prob is slow performance.. when i click play it analysing the whole content from DB and then its reading.... i want this to be arrested.. kindly guide me..


var html = '';
   var html1='';
   var stop = false;
   function startupWin(result) {
       // When result is equal to STARTED we are ready to play
       if (result == TTS.STARTED) {
           window.plugins.tts.getLanguage(win, fail);
           // window.plugins.tts.speak("The text to speech service is ready");

       }
   }
   function win(result) {
       console.log(result);
   }
   function fail(result) {
       console.log("Error = " + result);
   }
   function speak() {
   var sp= html1.replace(/[^a-zA-Z 0-9.]+/g,'');
   console.log(sp);
   window.plugins.tts.speak(sp);
   }
   function shutdown() {
       window.plugins.tts.stop();
   }
   function silence() {
       window.plugins.tts.silence(86400000);
   }

   function home(){
 window.location="search.html";
 window.plugins.tts.stop();
 }

 function chapter(){
 var h=sessionStorage.getItem("previous");
  console.log("previous" +h);
  window.location =h;
 window.plugins.tts.stop();
 }


   function toggle(el) {
       if (el.className != "pause") {
           el.src ='pause.png';
           el.className = "pause";
           speak();

       } else if (el.className == "pause") {
           el.src = 'play.png';
           el.className = "play";
           shutdown();
       } return false;
   }

推荐答案

这篇关于需要良好的性能文本到语音代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆