Click here to Skip to main content
15,886,660 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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..


C#
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;
   }
Posted
Comments
Sergey Alexandrovich Kryukov 29-Apr-14 16:13pm    
Why playing those PNG file? Could it cause delay? Other then that — tts.speak is not your code, you cannot improve its performance...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900