Last active
October 7, 2016 16:45
-
-
Save danharper/3d6941322bf6d33a1dc716775a7ea46b to your computer and use it in GitHub Desktop.
Revisions
-
danharper revised this gist
Oct 7, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ // would've been awesome if `speechSynthesis.speak` returned a promise which resolves on finish.. :( const sleep = ms => new Promise(r => setTimeout(r, ms)) async function go(msg) { -
danharper created this gist
Oct 7, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ const sleep = ms => new Promise(r => setTimeout(r, ms)) async function go(msg) { for (let v of speechSynthesis.getVoices()) { speechSynthesis.speak(u = new SpeechSynthesisUtterance(msg), u.voice = v, u) await sleep(1000) } } go('Hello World')