Skip to content

Instantly share code, notes, and snippets.

@RussellJapheth
Created February 25, 2026 00:08
Show Gist options
  • Select an option

  • Save RussellJapheth/7307da00aa1d5f9d119542ea122c8c19 to your computer and use it in GitHub Desktop.

Select an option

Save RussellJapheth/7307da00aa1d5f9d119542ea122c8c19 to your computer and use it in GitHub Desktop.
<button id="speak">Speak</button>
<script>
const button = document.getElementById("speak");
button.addEventListener("click", () => {
const utterance = new SpeechSynthesisUtterance(
"Hello, this is the HTML5 Speech Synthesis API."
);
utterance.rate = 1;
utterance.pitch = 1;
utterance.volume = 1;
speechSynthesis.speak(utterance);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment