Domain name for API request: trtc.tencentcloudapi.com.
Initiate the transcription bot. The backend will pull the stream through the bot to perform real-time speech recognition and deliver subtitles and transcription messages. The transcription bot supports two stream pulling modes, controlled by the TranscriptionMode
field:
The server delivers subtitles and transcription messages in real-time through TRTC's custom messages, with CmdId
fixed at 1. The client only needs to listen for the callback of custom messages. For example, see the C++ callback. Other clients, such as Android, Web, etc., can also be found at the same link.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: StartAITranscription. |
Version | Yes | String | Common Params. The value used for this API: 2019-07-22. |
Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-guangzhou, ap-singapore, ap-tokyo, na-siliconvalley. |
SdkAppId | Yes | Integer | TRTC's SdkAppId is the same as the SdkAppId used by the room that starts the transcription task. |
RoomId | Yes | String | TRTC's RoomId, which indicates the room number where the transcription task is started. |
TranscriptionParams | Yes | TranscriptionParams | Parameters of the transcription robot. |
SessionId | No | String | The unique ID passed by the caller is used by the server to deduplicate. Note: If this parameter is passed, the server will use it first to deduplicate. If this parameter is not passed, the server's deduplication strategy is as follows: - If the TranscriptionMode field is 0, only one task can be opened in a room - If the TranscriptionMode field is 1, only one task can be opened in a TargetUserId |
RoomIdType | No | Integer | The type of TRTC room number. 0 represents a numeric room number, and 1 represents a string room number. If not filled in, the default is a numeric room number. |
RecognizeConfig | No | RecognizeConfig | Speech recognition configuration. |
Parameter Name | Type | Description |
---|---|---|
TaskId | String | Used to uniquely identify a transcription task. |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: trtc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: StartAITranscription
<Common request parameters>
{
"SdkAppId": 1234,
"RoomId": "1234",
"RoomIdType": 1,
"TranscriptionParams": {
"UserId": "abc",
"UserSig": "abc",
"MaxIdleTime": 60,
"TranscriptionMode": 1,
"TargetUserId": "abc"
}
}
{
"Response": {
"TaskId": "abc",
"RequestId": "abc"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
FailedOperation.NotAbility | Need to unlock the required ability |
FailedOperation.NotAllowed | This operation is not allowed, please submit a ticket to contact us |
FailedOperation.SdkAppIdNotUnderAppId | There is no resource for this SdkAppId In this AppId |
FailedOperation.TaskExist | Task already exists |
InvalidParameter.UserSig | UserSig is expired or wrong |
InvalidParameter.UserSigNotAdmin | |
ResourceInsufficient.RequestRejection | Insufficient resources. |
この記事はお役に立ちましたか?