`speechSynthesis.clear()` removes following `speechSynthesis.speak(....)` instances as well. JSFiddle: https://jsfiddle.net/4perg5cs/1/ Code for reproduction: ``` var synth = window.speechSynthesis; var utterance1 = new SpeechSynthesisUtterance('How about we say this now? This is quite a long sentence to say.'); var utterance2 = new SpeechSynthesisUtterance('We should say another sentence too, just to be on the safe side.'); var utterance3 = new SpeechSynthesisUtterance('WebKit only speaks this.'); synth.speak(utterance1); synth.cancel(); synth.speak(utterance2); synth.speak(utterance3); // actual result: only utterance3 is spoken // expected result: utterance2 is spoken, then utterance3 is spoken ``` Note: adding multiple `speechSynthesis.speak(....)` before utterance3 won't change the actual result.
As reference, this doesn't happen on: - Chrome 70.0.3538.102 - Firefox 63.0.1
<rdar://problem/46151521>
(In reply to Giovanni Piller Cottrer from comment #1) > As reference, this doesn't happen on: > - Chrome 70.0.3538.102 > - Firefox 63.0.1 yea seems like we're not honoring this " If it is not paused and no other utterances are in the queue, then this utterance is spoken immediately, else this utterance is queued to begin speaking after the other utterances in the queue have been spoken" https://w3c.github.io/speech-api/speechapi.html#tts-attributes
(In reply to chris fleizach from comment #3) > (In reply to Giovanni Piller Cottrer from comment #1) > > As reference, this doesn't happen on: > > - Chrome 70.0.3538.102 > > - Firefox 63.0.1 > > yea seems like we're not honoring this > > " If it is not paused and no other utterances are in the queue, then this > utterance is spoken immediately, else this utterance is queued to begin > speaking after the other utterances in the queue have been spoken" > > https://w3c.github.io/speech-api/speechapi.html#tts-attributes NSSpeechSynthesizer doesn't do any queuing by default, so we're getting bit by that
(In reply to chris fleizach from comment #4) > (In reply to chris fleizach from comment #3) > > (In reply to Giovanni Piller Cottrer from comment #1) > > > As reference, this doesn't happen on: > > > - Chrome 70.0.3538.102 > > > - Firefox 63.0.1 > > > > yea seems like we're not honoring this > > > > " If it is not paused and no other utterances are in the queue, then this > > utterance is spoken immediately, else this utterance is queued to begin > > speaking after the other utterances in the queue have been spoken" > > > > https://w3c.github.io/speech-api/speechapi.html#tts-attributes > > NSSpeechSynthesizer doesn't do any queuing by default, so we're getting bit > by that hmm, but SpeechSynthesis looks like it should be handling queueing