diff options
Diffstat (limited to 'planed.html')
-rw-r--r-- | planed.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/planed.html b/planed.html index 4df0f34..177ee2a 100644 --- a/planed.html +++ b/planed.html @@ -39,8 +39,12 @@ div.msg { let loglen = 0; let voices = []; speechSynthesis.onvoiceschanged = function() { - voices = speechSynthesis.getVoices(); - } + voices = speechSynthesis.getVoices().filter( + function(v) { + v.lang.startsWith("en"); + } + ); + }; ws.onmessage = function(ev) { loglen += 1; @@ -51,7 +55,6 @@ div.msg { let utter = new SpeechSynthesisUtterance(ev.data); utter.voice = voices[Math.floor(Math.random() * voices.length)]; utter.rate = 1.3; - utter.lang = 'en-GB'; speechSynthesis.speak(utter); }; |