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.

1.4 KiB

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 = [
    'ent' => 'cn_vip'
    //...  
];

// 这里的$app_id、$api_key、$api_secret是在开放平台控制台获得
$client = new IFlytek\Xfyun\Speech\IseClient($app_id, $api_key, $api_secret, $ttsConfig);

// 返回识别结果
$content = $client->request('欢迎使用科大讯飞语音能力', './test.pcm');

更详细请参见Demo

合成参数
参数 类型 必须 说明 示例
aue string 音频编码
raw未压缩的 pcm 格式音频)
speex标准开源speex
raw
speex_size string 标准speex解码帧的大小
当aue=speex时若传此参数表明音频格式为标准speex
解码帧大小请参考这里
70
result_level string 评测结果等级
entirety默认值
simple
entirety
language string 评测语种
en_us英语
zh_cn汉语
zh_cn
category string 评测题型
read_syllable单字朗读汉语专有
read_word词语朗读
read_sentence句子朗读
read_chapter(篇章朗读)
read_sentence
extra_ability string 拓展能力
multi_dimension(全维度 )
multi_dimension