Created
August 23, 2022 09:34
-
-
Save WoolDoughnut310/120a04974f079f4c815d761c33429350 to your computer and use it in GitHub Desktop.
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
const speech = new SpeechSynthesisUtterance(); | |
// Set to your language code | |
speech.lang = "en"; | |
const say = (text: string) => { | |
speech.text = text; | |
window.speechSynthesis.speak(speech); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment