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

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

性别年龄识别

示例代码
<?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格式
speexspeex格式rate需设置为8000
speex-wb宽频speex格式rate需设置为16000
amramr格式rate需设置为8000
amr-wb宽频amr格式rate需设置为16000
rate int 音频采样率 16000/8000