Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Flite TTS ====== ===== About ===== **Speech CS CMU ** Carnegie Mellon University\\ 5000 Forbes Ave\\ Pittsburgh, PA 15213\\ USA Website: __[[http://www.speech.cs.cmu.edu/flite/|http://www.speech.cs.cmu.edu/flite/]]__ ===== Definition ===== Flite is a free open source Text-to-Speech engine. Flite (Festival Lite) is a small, fast run-time synthesis engine developed at CMU and primarily designed for small embedded machines and/or large servers. ===== Languages ===== American, English ===== Installation ===== Unzip and untar the Flite package by using the command: <code> # tar xvzf flite_V1.x_date.tar.gz </code> Go to the directory of the Flite and then, type the following command. <code> # cd flite_V1.x_date # ./install.sh </code> ===== Configuration ===== This is the PHP script used to generate wav files from Flite: <code> <?php error_reporting ( E_ALL ); include("config.php"); include("ttslib.php"); if(!defined('DEBUG')) error_reporting(0); debug("Mode debug enabled"); if(isset($_POST["text"])){ $text = $_POST["text"]; if(isset($_POST["format"])) $format = $_POST["format"]; debug(" POST VARIABLES :"); debug(print_r( $_POST,true)); }elseif(isset($_GET["text"])){ $text = $_GET["text"]; if(isset($_GET["format"])) $format = $_GET["format"]; debug(" GET VARIABLES :"); debug(print_r( $_GET,true)); }else httperror(); debug(" text = $text"); debug(" format = $format"); switch($format){ case 'gif': headerdebug("Content-Type: image/gif"); headerdebug('Content-Disposition: attachment; filename="file.gif"'); break; case 'wav': default : headerdebug("Content-Type: audio/wav"); headerdebug('Content-Disposition: attachment; filename="file.wav"'); } $filename=tempnam("/tmp",$ttsname."TMP"); $file=fopen($filename, "w"); debug(" Temp file = $filename"); register_shutdown_function('cleanup',"$filename"); fwrite($file, $text); fwrite($file, "\n"); fclose($file); $program = "/usr/bin/flite"; $time_start = microtime(true); register_shutdown_function('cleanup',"$filename.wav"); exec($program." -f $filename -o $filename.wav", $return, $status); $time_end = microtime(true); $texec = $time_end - $time_start; $outsize=filesize("$filename.wav"); readfile("$filename.wav"); if($enable_record_to_cdr) register_shutdown_function('cdrrecord',$ttsname,$lang,$status,$texec,$text,$outsize); register_shutdown_function('garbage',$ttsname); // vim: set filetype=php expandtab tabstop=2 shiftwidth=2 autoindent smartindent: ?> </code> The TTS package install the HTTP scripts in: <code> /var/www/tts/flite </code> In a default Debian installation, you can test the TTS installation with : <code> http://yourip/tts/flite/index.php </code> This web page will generate wav files in PCM 16bit 8kHz mono. ===== Release Notes ===== Install the script on your Apache/PHP server. Configure the VoiceXML Browser (Text-to-Speech Option) and restart the VoiceXML interpreter to get the new configuration. Flite have a dependency to libasound (with Debian install the package libasound2). legacy/text-to-speech_guide/flite_tts/start.txt Last modified: 2017/07/28 23:34by javier