I am trying to convert words to speech ..
Untill now I have tried this:
<?php
 $text = "Hello this is a test for voice api of google";
// Name of the MP3 file generated using the MD5 hash
   $file  = md5($text);
// Save the MP3 file in this folder with the .mp3 extension 
   $file = "audio/" . $file .".mp3";
   if($file) {
     echo "created";
   } else {
     echo "not created";
   }
// If the MP3 file exists, do not create a new request
   if (!file_exists($file)) {
     $mp3 = file_get_contents(
        'http://translate.google.com/translate_tts?q=' . $text);
     echo "hello";
     file_put_contents($file, $mp3);
   } else {
     echo "hii";
   }
?>
In my html file :
<audio controls="controls" autoplay="autoplay">
  <source src="<?php echo $file; ?>" type="audio/mp3" />
</audio>
I am getting created hello and an audio player in output. But no file is played and neither it is created in the folder?