28e6dcfced1035ae433d0d3af620a49d07e29816
[php.git] / festival-php / index.php
1 <?php
2
3 $lang=$_GET['tl'];
4 $text=$_GET['q'];
5
6 if ( !$text ) {
7   exit;
8 }
9
10 include("festival_class_inc.php");
11 $tts = new festival;
12 $fullPath=$tts->text2Wav($text,$lang);
13
14 if ($fd = fopen ($fullPath, "r")) {
15     $fsize = filesize($fullPath);
16     $path_parts = pathinfo($fullPath);
17     $ext = strtolower($path_parts["extension"]);
18     header("Content-type: application/octet-stream");
19     header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
20     header("Content-length: $fsize");
21     header("Cache-control: private"); //use this to open files directly
22     while(!feof($fd)) {
23         $buffer = fread($fd, 2048);
24         echo $buffer;
25     }
26 }
27 fclose ($fd);
28
29 // $tts->text2Speech('The authors email address is. p scott @ u w c dot a c dot zed ay');
30
31 ?>