Permalink
Browse files

plus safari

  • Loading branch information...
stoyan committed Mar 13, 2018
1 parent d614f8f commit 33743a86cfb3d6ec5bd099a044b8143ecb148dff
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/App.js
@@ -36,14 +36,21 @@ const iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
let webvoices = null;
if (
'SpeechSynthesisUtterance' in window &&
'speechSynthesis' in window &&
'onvoiceschanged' in speechSynthesis
'speechSynthesis' in window
) {
speechSynthesis.onvoiceschanged = () => {
webvoices = speechSynthesis.getVoices().filter(v => v.lang === 'it-IT' && v.localService);
if ('onvoiceschanged' in speechSynthesis) {
speechSynthesis.onvoiceschanged = () => {
webvoices = getVoices();
}
} else if (speechSynthesis.getVoices) {
webvoices = getVoices();
}
}

function getVoices() {
return speechSynthesis.getVoices().filter(v => v.lang === 'it-IT' && v.localService);
}

let term;

let settings = {};

0 comments on commit 33743a8

Please sign in to comment.