daisycmyk Posted April 15, 2012 Share Posted April 15, 2012 Im having a problem with embedding/executing 'text2wave' command inside php script. I want to read one text file (in this case text1.txt) , covert it into (wav/mp3) format and play that file. (automatically on page load or on form button click) Im using somewhat modified version of php script located here http://www.xenocafe.com/tutorials/php/festival_text_to_speech/index.php My code snippet <?php if(isset($response)){ //echo $response; echo "<br/>"; // if(!empty($response)){ $wave_file='test1.wav'; $speech_file='test1.txt'; $volume_scale=50; $fh = fopen($speech_file, "w+"); if ($fh) { fwrite($fh, $response); fclose($fh); } if (file_exists($speech_file)) { // create the text2wave command and execute it [b] $cmd = "text2wave $speech_file -o $wave_file";[/b] echo $cmd; [b] exec($cmd);[/b] // this is not working echo exec('date');// this is working //unlink($wave_file); } echo '<embed height="19" width="185" src="test1.wav" visibility="true"></embed>';} } Sorry about this scrappy code , im not very good at php .. yet. exec($cmd) part is not working , text1.wav file is not being generated(which it must) Does it has to with ENVIRONMENTAL VARIABLES or PATH? But $text2wave $speech_file -o $wave_file from shell is working without a problem. Thanks in advance.Any help would be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/260969-problem-with-festival-tts-in-php/ Share on other sites More sharing options...
daisycmyk Posted April 16, 2012 Author Share Posted April 16, 2012 awe .. no replies yet?? Quote Link to comment https://forums.phpfreaks.com/topic/260969-problem-with-festival-tts-in-php/#findComment-1337724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.