mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
eliminate utterance queuing
This commit is contained in:
parent
ea3f044816
commit
8b1c109b9c
1 changed files with 1 additions and 0 deletions
|
@ -6,6 +6,7 @@ countdown = (seconds) ->
|
||||||
for i in [seconds..1]
|
for i in [seconds..1]
|
||||||
if window.speechSynthesis?
|
if window.speechSynthesis?
|
||||||
utterance = new SpeechSynthesisUtterance "#{i}"
|
utterance = new SpeechSynthesisUtterance "#{i}"
|
||||||
|
window.speechSynthesis.cancel() # cancel any prior utterances
|
||||||
window.speechSynthesis.speak utterance
|
window.speechSynthesis.speak utterance
|
||||||
console.log i
|
console.log i
|
||||||
await sleep 1000 # wait one second
|
await sleep 1000 # wait one second
|
||||||
|
|
Loading…
Reference in a new issue