In this demonstration:
>tts is done on server side (i.e by using SpeechUtil server)
>then the audio received from speechutil.com is saved on your server (local/production)
>and then that saved audio is played through that saved file on this webpage.
Tested with:
Chrome v21 [Working],
Firefox v14 [Working],
IE v9[Not Working, IE does not support ogg audio format playback]
$text
));
//for wav file format use http://speechutil.com/convert/wav? below
if ($soundfile = file_get_contents("http://speechutil.com/convert/ogg?".$querystring))
{
file_put_contents($filename,$soundfile);
echo ('
Saved mp3 location : '.dirname(__FILE__).'\\'.$filename.'
Saved mp3 uri : '.$_SERVER['SERVER_NAME'].'/webtts/'.$filename.''
);
}
else echo(" Audio could not be saved");
}
?>?php
if>!doctype>