set $text

This commit is contained in:
Denny Dai
2015-06-26 14:14:14 +08:00
parent d0391f4a7e
commit 1ab6510772
6 changed files with 8 additions and 7 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
<?php
PluginList("tts", "Text To Speech");
if (preg_match("/^".TAG."tts (.*)$/", $_GET['text'], $matches)) {
if (preg_match("/^".TAG."tts (.*)$/", $text, $matches)) {
$mp3 = file_get_contents("http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=".urlencode($matches[1]));
$file = fopen($_GET['from'].".mp3","w");
$file = fopen($from.".mp3","w");
echo fwrite($file,$mp3);
fclose($file);
$BOT->send_audio($from, "/home/wwwroot/1.vps.dennx.com/".$_GET['from'].".mp3");
$BOT->send_audio($from, "/home/wwwroot/1.vps.dennx.com/".$from.".mp3");
//unlink($matches[1].".mp3");
}