Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2010 04:24
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Experimental page to test html5 <audio> tag with google translate tts technology.
<!DOCTYPE html>
<title>Say it to me!</title>
<link rel="stylesheet" href="">
text-align: center;
input, button{
font-size: 2em;
width: 70%;
margin: 0 0 1em;
padding: .2em;
<h1>Say it to me!</h1>
<form id="say-form">
<input value="Awesome" id="say-text">
<button id="say-button">Say!</button>
<script src=""></script>
var audioTagSupport = !!(document.createElement('audio').canPlayType);
if (!audioTagSupport) return false;
var text = $.trim($('#say-text').val());
if (text == '') return false;
var audio = document.createElement('audio');
audio.setAttribute('src', '' + encodeURIComponent(text));
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment