Here's the sample code for PHP and TTS. Obviously, this speaks on the machine where the PHP is executed. This means it's really only useful on the commandline or on a local web server. Of course, you could also set it up to be able to scare folks in the server room, but ….
Here's the code snippet. Really, that's all you need (aside from a Windows PHP installation).
source:
http://sourceforge.net/projects/php-vox/
use site:
The voices need work, but this is awesome! I saw it in use on pilotpig.net and it's got some great potential!
(http://www.pilotpig.com/) already has a PHP text-to-speech thing on there, but they use Linux. On the next version of my website, you'll be able to see it. Well, hear it….
Here's the code snippet. Really, that's all you need (aside from a Windows PHP installation).
$text = file_get_contents("presentation.txt");
//or manually set the string
//$text = "This is a test of the non-emergency broadcast system.";
$VoiceObj = new COM("SAPI.SpVoice");
$VoiceObj->Speak($text);
//or manually set the string
//$text = "This is a test of the non-emergency broadcast system.";
$VoiceObj = new COM("SAPI.SpVoice");
$VoiceObj->Speak($text);
source:
http://sourceforge.net/projects/php-vox/
use site:
The voices need work, but this is awesome! I saw it in use on pilotpig.net and it's got some great potential!
(http://www.pilotpig.com/) already has a PHP text-to-speech thing on there, but they use Linux. On the next version of my website, you'll be able to see it. Well, hear it….
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/2885/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2010-4-3 01:16
评论列表