X-Git-Url: https://git.rvb.name/php.git/blobdiff_plain/9cf7b175a225631376944019ad302d078a3a495b..aea3ac7e69b9aa0c21108105fc4de0a0e6878e31:/festival-php/index.php?ds=inline diff --git a/festival-php/index.php b/festival-php/index.php index bc26996..4b0a5e1 100644 --- a/festival-php/index.php +++ b/festival-php/index.php @@ -7,26 +7,16 @@ if ( !$text ) { exit; } -include("festival_class_inc.php"); -$tts = new festival; -$fullPath=$tts->text2Wav($text,$lang); +include("voice_class_inc.php"); +$tts = new voice; +$data=$tts->text2Wav($text,$lang); -if ($fd = fopen ($fullPath, "r")) { +if ($data) { $fsize = filesize($fullPath); - $path_parts = pathinfo($fullPath); - $ext = strtolower($path_parts["extension"]); - header("Content-type: application/octet-stream"); - header("Content-Disposition: filename=\"".$path_parts["basename"]."\""); - header("Content-length: $fsize"); - header("Cache-control: private"); //use this to open files directly - while(!feof($fd)) { - $buffer = fread($fd, 2048); - echo $buffer; - } + $path_parts = pathinfo(); + $ext = 'mp3'; + header("Content-type: audio/mpeg"); + echo $data; } -fclose ($fd); -unlink($fullPath); - -// $tts->text2Speech('The authors email address is. p scott @ u w c dot a c dot zed ay'); ?>