Audio stream moderation is an interactive extension service of ZEGOCLOUD's real-time audio and video products. Through the audio stream moderation interface, developers can call real-time audio moderation, including audio semantic recognition and audio feature (pitch, timbre, voiceprint, melody, etc.) recognition. ZEGOCLOUD will send the recognition results to developers through Callback on moderated audio streams or configured custom callback addresses. The Start moderating audio streams feature should be used in conjunction with Stop moderating audio streams.
Before using this method for the first time, you need to contact ZEGOCLOUD technical support to activate it.
Request method: POST
When using POST request method to pass parameters:
Request endpoint: https://rtc-api.zego.im/?Action=StartCensorAudioV2
Protocol: HTTPS
Rate limit (all rooms with the same AppID): 100 requests/second
Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Server APIs public request parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
RoomId |
String |
Yes |
The room ID that needs audio moderation. By default, all streams in the room will be submitted for moderation. If there are streams in the room that do not need moderation (such as streams from trusted users), please set ZegoPulisherConfig.streamCensorshipFlag to disallow moderation when calling the client SDK startPublishingStream. |
EventId |
String |
Yes |
Scene identifier. This parameter identifies the scene corresponding to the audio stream. The moderation strategy can be adjusted according to the scene to achieve control of different scene moderation standards.
|
ResultCallbackUrl |
String |
No |
Custom callback address for moderation results. If you need to send the moderation results of this moderation task through another callback address, you can achieve this through this parameter. If not needed, please contact ZEGOCLOUD technical support for processing. |
StatusCallbackUrl |
String |
No |
Custom callback address for moderation status. If you need to send the moderation status of this moderation task through another callback address, you can achieve this through this parameter. If not needed, please contact ZEGOCLOUD technical support for processing. |
IsMixingEnabled |
Int32 |
No |
Whether to submit for moderation through stream mixing.
|
AudioLanguage |
String |
Yes |
Audio stream language. When semantic recognition of audio streams is needed, please input this value accurately. If the following languages cannot meet your needs, please contact technical support for configuration. zh: Chinese, ja: Japanese, ko: Korean, th: Thai vi: Vietnamese, ms: Malay, tl: Filipino, id: Indonesian hi: Hindi, ar: Arabic, tr: Turkish, en: English es: Spanish, pt: Portuguese, it: Italian, fr: French de: German, ru: Russian |
RiskTypeList |
Array of String |
No |
Risk type list. At least one of RiskTypeList and BusinessTypeList must not be empty. The following values can be added to the array:
|
BusinessTypeList |
Array of String |
No |
Business recognition categories. At least one of RiskTypeList and BusinessTypeList must not be empty. The following values can be added to the array:
Audio stream recognition is not limited to violation content, it can also assist developers in business operations. If the above optional values cannot meet your business needs, please contact ZEGOCLOUD technical support. |
LabelLanguage |
String |
Yes |
Language type of labels in callback information (Label related).
|
ReturnAllText |
Int32 |
No |
Whether to return all text for the current 10s segment. The risk levels of moderation results will be classified into three categories: PASS: Normal content, recommended to pass directly. REVIEW: Suspicious content, recommended for manual review. REJECT: Violating content, recommended to block directly.
|
ReturnPreAudio |
Int32 |
No |
Whether to return the audio segment link before the violating segment.
|
ReturnFinishInfo |
Int32 |
No |
Whether to perform "moderation task status" callback when the moderation task ends.
|
https://rtc-api.zego.im/?Action=StartCensorAudioV2
&<Common request parameters>
{
"RoomId": "room_1",
"IsMixingEnabled": 0,
"EventId": "live_streaming",
"RiskTypeList": [
"ADLAW",
"ADVERT",
"AUDIOPOLITICAL",
"BAN",
"DIRTY",
"EROTIC",
"MOAN",
"POLITY",
"VIOLENT"
],
"AudioLanguage": "zh",
"LabelLanguage": "zh",
"ReturnAllText": 1,
"ReturnPreText": 1,
"ReturnPreAudio": 1,
"ReturnFinishInfo": 1,
"ResultCallbackUrl": "",
"StatusCallbackUrl": ""
}
| Parameter | Type | Description |
|---|---|---|
Code |
Int32 |
Return code.
|
Message |
String |
Operation result description. |
RequestId |
String |
Request ID. |
Data |
Object |
Response data. |
TaskId |
String |
Moderation task ID, used to end the moderation task. |
{
"Code":0,
"Message":"success",
"RequestId":"TestRequestId1635941437248027000",
"Data":{
"TaskId":"15515d8fef61801b05c22e0ebbe8681f"
}
}
Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.
| Return Code | Description | Handling Suggestion |
|---|---|---|
| 50006, 50007 | HTTP request failed. | Please try again later (recommended 300s), or contact ZEGOCLOUD technical support. |
| 50009 | Moderation failed. | Please try again later (recommended 300s), or contact ZEGOCLOUD technical support. |
| 50117 | Configuration error, Shumei permission not enabled. | Please contact ZEGOCLOUD technical support. |
