Skip to content

Instantly share code, notes, and snippets.

@WoolDoughnut310
Created August 23, 2022 09:34
Show Gist options
  • Save WoolDoughnut310/120a04974f079f4c815d761c33429350 to your computer and use it in GitHub Desktop.
Save WoolDoughnut310/120a04974f079f4c815d761c33429350 to your computer and use it in GitHub Desktop.
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