You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1002 B
1002 B
性别年龄识别
示例代码
<?php
include './vendor/autoload.php';
// 设置识别参数
$ttsConfig = [
'aue' => 'raw',
'rate' => 16000
//...
];
// 这里的$app_id、$api_key、$api_secret是在开放平台控制台获得
$client = new IFlytek\Xfyun\Speech\IgrClient($app_id, $api_key, $api_secret, $ttsConfig);
// 返回识别结果
$content = $client->request('./test.pcm');
更详细请参见Demo
合成参数
参数名 | 类型 | 必传 | 描述 |
---|---|---|---|
ent | string | 是 | 引擎类型,目前仅支持igr |
aue | string | 是 | 音频格式 raw:原生音频数据pcm格式 speex:speex格式(rate需设置为8000) speex-wb:宽频speex格式(rate需设置为16000) amr:amr格式(rate需设置为8000) amr-wb:宽频amr格式(rate需设置为16000) |
rate | int | 是 | 音频采样率 16000/8000 |