require_once 'AipSpeech.php';

// 你的 APPID AK SK

const APP_ID = '23***065';

const API_KEY = 'RXtjT****eqhM';

const SECRET_KEY = 'g8p7*****x3';

$client = new AipSpeech(APP_ID, API_KEY, SECRET_KEY);

$ttt="你好百度23333";

$result = $client->synthesis('你好百度2333', 'zh', 1, array('vol' => 5,));

echo "结果为 $result

";

// 识别正确返回语音二进制 错误则返回json 参照下面错误码

if(!is_array($result))

{

file_put_contents('audio.mp3', $result);

}

else

{

echo "没有结果为 $ttt

";

}

?>

执行出来的结果是

结果为 Array

没有结果为 你好百度

什么地方出问题啊

Logo

一站式 AI 云服务平台

更多推荐