i want to use the cancel Method of window.SpeechSynthesis in Chrome, to cut off an Utterance and start a new one (so you dont have to hear all utterances which are still in queue)
var test = new SpeechSynthesisUtterance("Test");
window.speechSynthesis.speak(test);
window.speechSynthesis.cancel();
var test2 = new SpeechSynthesisUtterance("Test2");
window.speechSynthesis.speak(test2);
Expected: Start speech with var test , but cancel it instantly due to cancel(). Then start speech again with var test2 , which should work fine.
Well of course that did not happen. But what happened was nothing. :D It seemed like calling speak() after cancel() somehow does nothing.
The API Description is the following:
This method removes all utterances from the queue. If an utterance is being spoken, speaking ceases immediately. This method does not change the paused state of the global SpeechSynthesis instance.
Thx for answers :)