I'm using the Speech Synthesis API on Google Chrome v34.0.1847.131. The API is implemented in Chrome starting in v33.
The text-to-speech works for the most part, except when assigning a callback to onend
. For instance, the following code:
var message = window.SpeechSynthesisUtterance("Hello world!");
message.onend = function(event) {
console.log('Finished in ' + event.elapsedTime + ' seconds.');
};
window.speechSynthesis.speak(message);
will sometimes call onend
and sometimes not call it. The timing appears to be completely off. When it does get called, the printed elapsedTime
is always some epoch time like 1399237888
.