From: Roman Bazalevsky Date: Wed, 21 Sep 2016 11:55:26 +0000 (+0300) Subject: Веб-прослойка для синтеза речи festival. X-Git-Url: https://git.rvb.name/php.git/commitdiff_plain/a79bfa56638c77c3d6bc7bcc2e0e80ad365dc9db?ds=inline Веб-прослойка для синтеза речи festival. Работает с уже запущенным сервером, поддерживает передачу языка в параметре. --- a79bfa56638c77c3d6bc7bcc2e0e80ad365dc9db diff --git a/festival-php/festival_class_inc.php b/festival-php/festival_class_inc.php new file mode 100644 index 0000000..2e48b31 --- /dev/null +++ b/festival-php/festival_class_inc.php @@ -0,0 +1,58 @@ + \ No newline at end of file diff --git a/festival-php/index.php b/festival-php/index.php new file mode 100644 index 0000000..28e6dcf --- /dev/null +++ b/festival-php/index.php @@ -0,0 +1,31 @@ +text2Wav($text,$lang); + +if ($fd = fopen ($fullPath, "r")) { + $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; + } +} +fclose ($fd); + +// $tts->text2Speech('The authors email address is. p scott @ u w c dot a c dot zed ay'); + +?>