sdk_app_id
) and room ID (room_id
). Generate a user ID (user_id
), which will allow the moderation system to enter the room and pull live content for moderation. We recommend you generate a different user ID for content moderation for each room. In addition to the user ID, you will also get the signature (user_sig
) for the moderation system.sdk_app_id
, room_id
, user_id``, and user_sig
obtained in the previous step to splice a moderation URL in the following format:trtc://trtc.tencentcloudapi.com/moderation?sdk_app_id=xxxx&room_id=xxxx&user_id=xxxx&user_sig=xxxx
user_sig
.sdk_app_id
, user_id
, user_sig
, and room_id
mentioned in this document correspond to SDKAppID
, UserID
, UserSig
, and RoomID
you use with the TRTC SDK.Parameter | Required | Description |
sdk_app_id | Yes | The ID assigned when an application is created in the TRTC console. |
room_id | Yes | The ID assigned when a room is created. The data type of this parameter may be string or numeric (default). To use string-type room IDs, set `room_id_type` to `string`. |
user_id | Yes | The user ID used by the moderation system to enter a room and pull data. We recommend you generate a different user ID for each room. |
user_sig | Yes | The security signature generated based on `sdk_app_id` and `user_id`. |
mix | No | If this is set to `true`, the streams in a room will be mixed first before moderation. If it is `false`, the streams in a room will be reviewed separately.With single-stream moderation, you can get from the moderation callback the specific users (user_id) whose streams contain non-compliant content. This is not possible with mixed-stream moderation. |
room_id_type | No | The data type of the room ID parameter. Valid values: string, number. |
Parameter | Required | Type | Description |
Action | Yes | String | A common parameter. For this API, its value is `CreateAudioModerationTask`. |
Version | Yes | String | A common parameter. For this API, its value is `2020-12-29`. |
Region | No | String | A common parameter. It’s used to specify a region outside the Chinese mainland. Currently, only Singapore (`ap-singapore`) is supported. |
Tasks.N | Yes | Array of TaskInput | The information of audio moderation tasks. For details, see the description of `TaskInput`.Note: You can create up to 10 tasks. |
BizType | No | String | The ID of the moderation policy, which is configured in the CMS console. Specify this parameter to use a specific moderation policy. If you do not pass in this parameter, the default moderation policy will be used.Note: Biztype can be 3-32 characters long and can contain numbers, letters, and underscores. Different Biztype values are associated with different business scenarios. Make sure you use the right Biztype. |
Type | No | String | The type of audio to moderate. Valid values: AUDIO(VOD audio), LIVE_AUDIO(live audio). The default is `AUDIO`. |
Seed | No | String | The callback signature key, which helps ensure data security. Add the field `X-Signature` to the HTTP response header. The value of the field is a SHA256 hash of `seed + body` represented in hexadecimal. After receiving the callback, use sha256(seed + body) to calculate the X-Signature for verification. For details, see Signature v3. |
CallbackUrl | No | String | The address to receive moderation results. The default format is a URL. After configuration, the information of non-compliant audio segments detected will be sent to this address. For the callback format, see Sample Callback Signature. |
CreateAudioModerationTask
API is called to create an audio moderation task. To start a video moderation task, call CreateVideoModerationTask.
Pay attention to the following:default
is created automatically. You can pass in this value for testing.
LIVE_AUDIO
; for video chat, the API of VMS (Video Moderation System) is used, and you should set this parameter to LIVE_VIDEO
.TaskId
) will be returned.TaskId
) to end the moderation task.trtc/{{sdk_app_id}}/screenshot_{{room_id}}_{{user_id}}{{timestamp}}.jpg (image format)trtc/{{sdk_app_id}}/audio{{room_id}}_{{user_id}}_{{timestamp}}.mp3 (audio format)
user_id
is mixer
.user_ID
of the moderation system cannot be identical to another user in the room.room_id
is a UNIT and its value range is 1-4294967295. You will be responsible for assigning and maintaining room IDs.user_sig
?user_sig
? How do I troubleshoot the “-3319” or “-3320” error during room entry?user_sig
, log in to the TRTC console and go to Development Assistance > UserSig Generation & Verification.trtc_[room_id]_[user_id]_timestamp
. You can tell which user a segment belongs to from the segment’s COS address.user_sig
may contain special characters, you should escape it first before including it in the URL.
Was this page helpful?