tencent cloud

APIs

Recording Recognition Callback Description

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-05-26 11:05:36

1. Callback Description

If you specify a CallbackUrl parameter in your audio recognition request, the recognition results are returned via callback. You must deploy an HTTP or HTTPS service that is accessible via a public network. When creating an audio recognition task, enter the callback Url in the CallbackUrl field. During callback, the HTTP POST method is used, and all content is placed in the Body. The Content-Type is application/x-www-form-urlencoded.

2. Callback Body Description

2.1 Callback Body Example

code=0&requestId=4000048858&appid=12516****&projectid=0&text=%5B0%3A1.640%2C0%3A4.600%5D++%E6%88%91%E5%9C%A8%E9%A9%AC%E4%B8%8A%E4%B8%8A%E5%A4%9C%E7%8F%AD%E3%80%82%0A%5B0%3A5.420%2C0%3A7.820%5D++%E6%98%8E%E5%A4%A9%E6%97%A9%E4%B8%8A%E8%AF%B4%E5%93%88%E3%80%82%0A&audioTime=8.420000&message=&resultDetail=

2.2 Callback Parameter Description

Field
Type
Description
code
int64
Task status code. 0 indicates success; other values indicate failure. For details, see Status Code Description.
message
string
Text description of the failure reason. This field is empty when the operation is successful.
requestId
uint64
Unique identifier of the task, which matches the TaskId returned in the speech recognition request. The data format must be set to Uint64.
appid
uint64
Tencent CloudApp ID
projectid
int64
Tencent Cloud project ID
audioUrl
string
Audio url. This field is not included if the task was created by uploading data.
text
string
Recognized result text
resultDetail
string
Contains the detailed recognition result. This field is not included if ResTextFormat is set to 0 when the task is created.
audioTime
double
Total audio duration

3. Callback Response Description

After receiving a callback request, the client side must return a response in JSON format.

3.1 Callback Response Example

{ "code" : 0, "message" : "success" }

3.2 Callback Response Parameter Description

Parameter Name
Type
Description
code
int64
Error code. 0 indicates success, and any other value indicates failure.
message
string
Description of the failure reason

4. Callback Status Codes

Value
Description
10000
Transcoding failed. Please verify whether the audio format meets the standard.
10001
Recognition failed
10002
Audio duration too short
10003
Audio duration too long
10004
Invalid audio file
10005
Other failures
10006
Number of audio tracks mismatched
10007
Audio download failure.

5. FAQs

5.1 How Many Times Will a Callback Be Retried?

A maximum of 2 times.

5.2 What Should I Do If I Haven't Received a Callback After a Long Time?

Ensure that the callback service is functioning properly and that the callback address is accessible via a public network.
If the callback address uses https, ensure that the certificate is certified by a legitimate CA.

Ajuda e Suporte

Esta página foi útil?

comentários