Last active
April 26, 2024 05:18
speaks english voices in given browsers
This file contains 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 characters
speakEnglish = () => { voices = speechSynthesis.getVoices(); voices.filter(voice => voice.lang === "en-US" ).forEach(voice => { | |
const utterance = new SpeechSynthesisUtterance("What's poppin, bitches?") | |
utterance.voice = voice; | |
// default volume !== 1 | |
utterance.volume = 1; | |
speechSynthesis.speak(utterance); | |
// next line causes function not to fire on first invocation 🤷🏾♂️ | |
utterance.addEventListener('start',()=>{console.log('voice name:', voice.name)}) | |
}) } | |
speakEnglish() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment