Demo entry 6642948

Text2Speech

   

Submitted by anonymous on Sep 26, 2017 at 09:13
Language: HTML. Code size: 775 Bytes.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>pr0speak</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  </head>
<body>

<script type="text/javascript">
//<![CDATA[

var searchParams = new URLSearchParams(window.location.search);
var text2peech = searchParams.get("q");

var say = function(text) {
  window.speechSynthesis.cancel();
  return window.speechSynthesis.speak(new SpeechSynthesisUtterance(text));
};

say(text2peech);
document.write(text2peech);

//]]>
</script>

<form action="say.html" role="form" method="get">
  <input type="text" name="q" />
  <input type="submit" value="Sprich!" />
</form>

</body>

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).