2015-05-30 00:20:55 +08:00
|
|
|
<?php
|
2015-05-30 01:30:08 +08:00
|
|
|
PluginList("tts", "Text To Speech");
|
2015-06-30 14:11:15 +08:00
|
|
|
if (preg_match("/^".preg_quote(TAG, '/')."tts (.*)$/", $text, $matches)) {
|
2015-06-04 17:25:51 +08:00
|
|
|
$mp3 = file_get_contents("http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=".urlencode($matches[1]));
|
2015-06-26 14:14:14 +08:00
|
|
|
$file = fopen($from.".mp3","w");
|
2015-05-30 00:20:55 +08:00
|
|
|
echo fwrite($file,$mp3);
|
|
|
|
fclose($file);
|
2015-06-26 14:14:14 +08:00
|
|
|
$BOT->send_audio($from, "/home/wwwroot/1.vps.dennx.com/".$from.".mp3");
|
2015-05-30 00:20:55 +08:00
|
|
|
//unlink($matches[1].".mp3");
|
|
|
|
}
|