百度语音合成
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist e-yunduan/yii2-aip-speech "*"
or add
"e-yunduan/yii2-aip-speech": "*"
to the require section of your composer.json
file.
配置文件添加组件 :
components => [
'aipSpeech' => [
'class' => 'eyunduan\aipSpeech\BaiduSpeech',
'appId' => 'xxxx', // 百度语音 App ID
'apiKey' => 'xxxx', // 百度语音 API Key
'secretKey' => 'xxxxxx', // 百度语音 Secret Key
],
]
/** @var \eyunduan\aipSpeech\BaiduSpeech $aipSpeech */
$aipSpeech = \Yii::$app->get('aipSpeech');
$aipSpeech->combine('您好,世界');