当前内容仅提供英语版本,中文版我们将尽快补充,感谢您的理解。
Feedback

StartAITranscription

1. API Description

Domain name for API request: trtc.intl.tencentcloudapi.com.

Start up the transcription bot. The backend will pass the robot stream pulling to perform real-time speech recognition and deliver subtitles and transcription messages.
The transcription bot supports two stream pulling methods, controlled by the TranscriptionMode field.

  • Pull the stream of all players in the room.
  • Pull the stream for a specific user.

The server delivers subtitles and transcription messages in real time through TRTC custom messages, with CmdId fixed to 1. Clients just need to listen to the custom message callback, such as the C++ callback (https://www.tencentcloud.com/document/product/647/79637?from_cn_redirect=1#4cd82f4edb24992a15a25187089e1565). Other clients such as Android and Web can likewise find it at the same link.

Note:
When TranscriptionMode is 0, ensure only one task is initiated in a room. If multiple tasks are initiated, robots will subscribe with each other. Unless the task is stopped proactively, it will timeout exit after 10 hours. In such cases, it is advisable to fill in SessionId to ensure subsequent repeated task failures.

A maximum of 50 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: StartAITranscription.
VersionYesStringCommon Params. The value used for this API: 2019-07-22.
RegionYesStringCommon 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.
SdkAppIdYesIntegerSdkAppId of TRTC, which is the same as the SdkAppId used by the room with transcription task enabled.
RoomIdYesStringRoomId of TRTC refers to the room number that enables the transcription task.
TranscriptionParamsYesTranscriptionParamsTranscription robot parameters.
SessionIdNoStringUnique Id passed by the caller, used by the server for task deduplication. duplicate tasks will fail to initiate. the server uses SdkAppId+RoomId+RoomIdType+RobotUserId for deduplication by default. if SessionId is provided, it will also be used for deduplication.
Note:.
When TranscriptionMode is 0, ensure only one task is initiated in a room. if multiple tasks are initiated, robots will subscribe to each other. unless the task is stopped proactively, it will timeout exit after 10 hours. in such cases, it is advisable to fill in SessionId to ensure subsequent repeated tasks fail.
RoomIdTypeNoIntegerType of the TRTC room number. 0 indicates digit room number, 1 indicates string room number. by default if left blank, it is digit room number.
RecognizeConfigNoRecognizeConfigSpeech recognition configuration.
TranslationConfigNoTranslationConfigTranslate configuration details.

3. Output Parameters

Parameter NameTypeDescription
TaskIdStringFor unique identification of transcription task.
RequestIdStringThe 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.

4. Example

Example1 Creating a Billing Resource Order

Input Example

POST / HTTP/1.1
Host: trtc.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: StartAITranscription
<Common request parameters>

{
    "SdkAppId": 1234,
    "RoomId": "500123",
    "RoomIdType": 1,
    "TranscriptionParams": {
        "UserId": "test_user",
        "UserSig": "your-usersig",
        "MaxIdleTime": 60,
        "TranscriptionMode": 1,
        "TargetUserId": "test_user"
    }
}

Output Example

{
    "Response": {
        "TaskId": "taskid",
        "RequestId": "requestid"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error CodeDescription
FailedOperation.NotAbilityUnlock the required capability bit.
FailedOperation.NotAllowedThis operation is not allowed. submit a ticket to contact us.
FailedOperation.SdkAppIdNotUnderAppIdNo resource belonging to this SdkAppId under the AppId.
FailedOperation.TaskExistTask already exists
InvalidParameter.UserSigUserSig is expired or wrong
InvalidParameter.UserSigNotAdminUserSig is not a super administrator.
ResourceInsufficient.RequestRejectionInsufficient resources.