3/04/2017

Text-To-Speech: Problem where TTS voice stops or never starts in Chrome / Windows bug

Well, I wasted a couple of days trying to figure out what was wrong with my awesome TTS program stopped working around the end of 2016 or beginning of 2017.

I thought maybe I had a competing script interfering with it, so I wrapped it in a namespace, and same problem.

Then I tried just cutting it down to the bare minimum, and sometimes it would work, but it would stop after about 2 sentences. And if it was more than a paragraph, the whole thing would work at all. It's very frustrating and disappointing to me, because I really want to make engaging Speech and Speech Recognition programs. But this is a total failure.

Except, it wasn't.

The problem is on the latest Windows 10 version of Chrome (). Everything works fine on my iPhone, on my Android phone, on my iMac, and on Windows 10 in Firefox and MS Edge and Opera.

So, what then .... Google is having a failure. The bugs have been reported to Chrome Bug Report, but no movement on the fix yet. They're kind of pessimistic about it even being a problem, from what I can read there. C'mon Google / Chromium team -- you're the best in the world. Get it fixed! xo

This script demonstrates the problem.

<html>
<head>
<script>
var synth = window.speechSynthesis;
var ttsStart = function () {
console.log("starting");
var myText = document.getElementById("myTextArea").value;
var utterThis = new SpeechSynthesisUtterance(myText);
synth.speak(utterThis);

utterThis.onstart = function(event) {
console.log('We have started uttering this speech: ' + event.utterance.text);
}
utterThis.onend = function (event) {
console.log("[Utterance ended]");
}
}
var ttsCancel = function () {
window.speechSynthesis.cancel();
}
</script>
</head>
<body>
<textarea id="myTextArea" cols="50" rows="15">
Up until about the end of 2016, or maybe in early 2017, Windows Chrome TTS functionality stopped working the way it used to. 
If you will notice, it stops around 200 or 300 characters even though the documentation says 32,768 characters is the 
maximum limit. On my PC browser, the text will have stopped being read before this point. And you would need to hit 
the Cancel button to reset the utterance because it is just hanging for no apparent reason. Longer passages, just under 
1400 characters, do not read aloud at all. Please fix, please because I love TTS so much. Thanks!</textarea><br />
<button id="start" onclick="ttsStart()">Start</button> <button id="cancel" onclick="ttsCancel()">Cancel</button> 

</body>
</html>

1 comment :

  1. Hello! I recently wish to offer a massive thumbs up to the great information you have here with this post. We are returning to your blog for much more soon. https://royalcbd.com/product/cbd-oil-2500mg/

    ReplyDelete