2

This is my Html5 code.. Problem is that "Text is not fully read by the voice. It stops in half way."What I need to do for that? Am using the script inside the html

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta charset="utf-8" />
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
  </script>
  <script>
    $(document).ready(function() {
      $("#startBtn").on('click', function(e) {
        debugger;
        var u1 = new SpeechSynthesisUtterance('I am a huge “Michael Jackson” fan, I feel he is one of the best entertainers this world has ever seen. He was not just an insanely talented singer, he was an incredible dancer with rhythm in his veins and a versatile composer and song writer. People like him come once in a millennium.');
        u1.lang = 'en-US';
        u1.pitch = 0;
        u1.rate = 0.7;

        //u1.voice = voices[10];
        u1.voiceURI = 'native';
        u1.volume = 1;
        speechSynthesis.speak(u1);

      });
    });
    s
  </script>
  <title></title>
</head>

<body>
  <input type="button" id="startBtn" value="Hello Word.." />
</body>

</html>
  • The problem here ha more to do with the rate set to 0.7, If you set it back to 1 it should be able to play the whole sentence – Kaiido Aug 18 '15 at 10:19
  • 1
    Rate is for speech speed.. Thats not a matter –  Aug 19 '15 at 10:47
  • I know what `rate`is for... if you set it to `0.2` , your sample text will block at "seen. He was" ; at `0.5` it will block at "singer, he wa" and to `1`, it won't block. So this tend to prove that the common belief in the dupe (that it is related to text length) is wrong (at least today, don't know if last year's bug was the same) since it's actually the length of the speech, not of the string which causes this bug. – Kaiido Aug 19 '15 at 11:03

0 Answers0