Skip to content

Instantly share code, notes, and snippets.

@fwaechter fwaechter/say.html
Last active Sep 27, 2017

What would you like to do?
Simple Text2Speech Snippet in 10 Lines of JavaScript using URLSearchParams (not Supported in Internet Explorer):
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript">
var searchParams = new URLSearchParams(;
var text2peech = searchParams.get("q");
var say = function(text) {
return window.speechSynthesis.speak(new SpeechSynthesisUtterance(text));
<form action="say.html" role="form" method="get">
<input type="text" name="q" />
<input type="submit" value="Sprich!" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.