3

The following code works for onstart and onend, but not for voices, onpause, onresume or the manual speechSynthesis.paused interval. Why?

Browser: Chrome Version 47.0.2526.111 m

http://jsfiddle.net/QYw6b/89/

or:

var u = new SpeechSynthesisUtterance();
var voices = speechSynthesis.getVoices();
u.voice = voices[0];
console.log(voices);
u.text = 'Hello World';

u.onstart = function (event) {
    console.log('Started');
};
u.onend = function (event) {
    console.log('Ended');
};

u.onpause = function(event) {
    console.log('Paused');
};
u.onresume = function(event) {
    console.log('Resumed');
};

setInterval(function() {
    if(speechSynthesis.paused)
        console.log("Now it's paused");}
,100);


setTimeout(function(){speechSynthesis.speak(u);},2000);
setTimeout(function(){speechSynthesis.pause();},3000);
setTimeout(function(){speechSynthesis.resume();},6000);
console.log(u);
Vertago
  • 315
  • 2
  • 16
  • Which browser are you using? – Sarah Elan Jan 19 '16 at 14:39
  • OS: Windows 7 Browser: Chrome Version 47.0.2526.111 m – Vertago Jan 19 '16 at 14:46
  • As far as voices, this array is only available [after the onvoiceschanged event has fired](http://stackoverflow.com/a/22978802/1873374). As far as the pause and resume events, [bug 425553](https://code.google.com/p/chromium/issues/detail?id=425553) seems to relate to this. Unfortunately that bug has been closed even though it is still an issue. – Sarah Elan Jan 19 '16 at 15:08

0 Answers0