【发布时间】:2011-11-02 04:01:30
【问题描述】:
我一直在编写一个与 festvox 一起使用的简单文本到语音 php 脚本,我一直在尝试使用它,但似乎我无法获得的部分是运行文本到波形转换器、shell 脚本。这是我到目前为止创建的代码,
<form action="index.php" method="get">
Say: <input type="text" name="say" />
<input type="submit" />
</form>
<?php
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $_GET["say"];
fwrite($fh, $stringData);
fclose($fh);
shell_exec('text2wave /var/www/text.txt -otype aiff -o /var/www/out.aiff');
?>
所以我想知道我可能会犯什么错误,有什么帮助吗?
【问题讨论】:
-
一个(不相关的)错误是没有利用
file_put_contents()。 -
你检查错误日志了吗?还是重定向stderr?
-
您可能需要提供 text2wave 的完整路径? /usr/bin/text2wave 等
标签: php shell command text-to-speech