e-yunduan / yii2-aip-speech

百度语音合成

安装: 54

依赖: 0

建议者: 0

安全性: 0

星标: 6

关注者: 2

分支: 2

开放问题: 0

类型:yii2-extension

v1.0.1 2017-11-22 13:22 UTC

This package is auto-updated.

Last update: 2024-09-25 21:12:14 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

百度语音合成

安装

安装此扩展的首选方式是通过 Composer

运行以下命令之一

php composer.phar require --prefer-dist e-yunduan/yii2-aip-speech "*"

"e-yunduan/yii2-aip-speech": "*"

将其添加到您的 composer.json 文件的 require 部分中。

用法

配置文件添加组件

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('您好,世界');