public class AsrClient extends AbstractClient
gson, HTTP_RSP_OK, SDK_VERSION
Constructor and Description |
---|
AsrClient(Credential credential,
String region) |
AsrClient(Credential credential,
String region,
ClientProfile profile) |
Modifier and Type | Method and Description |
---|---|
CreateAsrVocabResponse |
CreateAsrVocab(CreateAsrVocabRequest req)
用户通过本接口进行热词表的创建。
• 默认最多可创建30个热词表。 • 每个热词表最多可添加128个词,每个词最长10个字,不能超出限制。 • 热词表可以通过数组或者本地文件形式上传。 • 本地文件必须为UTF-8编码格式,每行仅添加一个热词且不能包含标点和特殊字符。 • 热词权重取值范围为[1,10]之间的整数,权重越大代表该词被识别出来的概率越大。 |
CreateRecTaskResponse |
CreateRecTask(CreateRecTaskRequest req)
本接口服务对录音时长1小时以内的录音文件进行识别,异步返回识别全部结果, HTTP RESTful 形式。
• 支持中文普通话、英语和粤语 • 支持通用和音视频领域 • 支持wav、mp3、silk、amr、m4a等主流音频格式 • 支持语音 URL 和本地语音文件两种请求方式 • 本地语音文件上传的文件不能大于5MB,语音 URL的音频时长不能长于1小时 • 支持回调或轮询的方式获取结果,结果获取请参考[ 录音文件识别结果查询](https://cloud.tencent.com/document/product/1093/37822)。 |
DeleteAsrVocabResponse |
DeleteAsrVocab(DeleteAsrVocabRequest req)
用户通过本接口进行热词表的删除。
|
DescribeTaskStatusResponse |
DescribeTaskStatus(DescribeTaskStatusRequest req)
在调用录音文件识别请求接口后,有回调和轮询两种方式获取识别结果。
• 当采用回调方式时,识别完成后会将结果通过 POST 请求的形式通知到用户在请求时填写的回调 URL,具体请参见[ 录音识别结果回调 ](https://cloud.tencent.com/document/product/1093/37139#callback)。 • 当采用轮询方式时,需要主动提交任务ID来轮询识别结果,共有任务成功、等待、执行中和失败四种结果,具体信息请参见下文说明。 |
DownloadAsrVocabResponse |
DownloadAsrVocab(DownloadAsrVocabRequest req)
用户通过本接口进行热词表的下载,获得词表权重文件形式的 base64 值,文件形式为通过 “|” 分割的词和权重,即 word|weight 的形式。
|
GetAsrVocabResponse |
GetAsrVocab(GetAsrVocabRequest req)
用户根据词表的ID可以获取对应的热词表信息
|
GetAsrVocabListResponse |
GetAsrVocabList(GetAsrVocabListRequest req)
用户通过该接口,可获得所有的热词表及其信息。
|
SentenceRecognitionResponse |
SentenceRecognition(SentenceRecognitionRequest req)
本接口用于对60秒之内的短音频文件进行识别。
• 支持中文普通话、英语、粤语。 • 支持本地语音文件上传和语音URL上传两种请求方式。 • 音频格式支持wav、mp3;采样率支持8000Hz或者16000Hz;采样精度支持16bits;声道支持单声道。 • 当音频文件通过请求中body内容上传时,请求大小不能超过600KB;当音频以URL方式传输时,音频时长不可超过60s。 • 所有请求参数放在POST请求的body中,编码类型采用x-www-form-urlencoded,参数进行urlencode编码后传输。 |
SetVocabStateResponse |
SetVocabState(SetVocabStateRequest req)
用户通过该接口可以设置热词表的默认状态。初始状态为0,用户可设置状态为1,即为默认状态。默认状态表示用户在请求识别时,如不设置热词表ID,则默认使用状态为1的热词表。
|
UpdateAsrVocabResponse |
UpdateAsrVocab(UpdateAsrVocabRequest req)
用户通过本接口进行对应的词表信息更新。
|
call, getClientProfile, getCredential, getRegion, internalRequest, setClientProfile, setCredential, setRegion
public AsrClient(Credential credential, String region)
public AsrClient(Credential credential, String region, ClientProfile profile)
public CreateAsrVocabResponse CreateAsrVocab(CreateAsrVocabRequest req) throws TencentCloudSDKException
req
- CreateAsrVocabRequestTencentCloudSDKException
public CreateRecTaskResponse CreateRecTask(CreateRecTaskRequest req) throws TencentCloudSDKException
req
- CreateRecTaskRequestTencentCloudSDKException
public DeleteAsrVocabResponse DeleteAsrVocab(DeleteAsrVocabRequest req) throws TencentCloudSDKException
req
- DeleteAsrVocabRequestTencentCloudSDKException
public DescribeTaskStatusResponse DescribeTaskStatus(DescribeTaskStatusRequest req) throws TencentCloudSDKException
req
- DescribeTaskStatusRequestTencentCloudSDKException
public DownloadAsrVocabResponse DownloadAsrVocab(DownloadAsrVocabRequest req) throws TencentCloudSDKException
req
- DownloadAsrVocabRequestTencentCloudSDKException
public GetAsrVocabResponse GetAsrVocab(GetAsrVocabRequest req) throws TencentCloudSDKException
req
- GetAsrVocabRequestTencentCloudSDKException
public GetAsrVocabListResponse GetAsrVocabList(GetAsrVocabListRequest req) throws TencentCloudSDKException
req
- GetAsrVocabListRequestTencentCloudSDKException
public SentenceRecognitionResponse SentenceRecognition(SentenceRecognitionRequest req) throws TencentCloudSDKException
req
- SentenceRecognitionRequestTencentCloudSDKException
public SetVocabStateResponse SetVocabState(SetVocabStateRequest req) throws TencentCloudSDKException
req
- SetVocabStateRequestTencentCloudSDKException
public UpdateAsrVocabResponse UpdateAsrVocab(UpdateAsrVocabRequest req) throws TencentCloudSDKException
req
- UpdateAsrVocabRequestTencentCloudSDKException
Copyright © 2020. All rights reserved.