Skip to content

e-yunduan/yii2-aip-speech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

baidu ai speech for Yii2

Latest Stable Version Total Downloads Latest Unstable Version License

百度语音合成

Installation

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.

Usage

配置文件添加组件 :

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