Documentation
Server_APIs_v2 Server APIs v2
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Server APIs v2
  • Server callbacks
  • Callback on moderated audio streams

Callback on moderated audio streams

Last updated:2025-05-22 16:15

1 Description

When developers need audio stream content moderation, after starting an Start moderating audio streams task, ZEGOCLOUD will send POST requests to the callback address to provide audio stream moderation results. When the ReturnFinishInfo parameter in the Start moderating audio streams task is set to 1, a moderation task status callback will be initiated after the moderation task ends.

2 Callback Description

  • Request method: POST

    The callback data format is JSON, and you need to perform UrlDecode decoding on it.

  • Request URL: Please contact ZEGOCLOUD technical support to configure the callback URL.
  • Protocol: HTTPS/HTTP, HTTPS recommended.

3 Callback Parameters

3.1 Moderation Result Callback

Common Parameters Type Description
Event
String
Callback event, returns censor_audio_v2_result for this callback.
AppId
Number
AppID.
Timestamp
Number
Server current time, Unix timestamp (seconds).
Nonce
String
Random number.
Signature
String
Signature.
Business Parameters Type Description
Code
Number
Return code.
0 indicates success.
Message
String
Operation result description.
TaskId
String
Moderation task ID.
Corresponds to the TaskId returned in Start moderating audio streams response parameters.
ResultTaskId
String
ID of this callback information.
Detail
Object
Moderation result details for the 10s segment.
RiskLevel
String
Risk level (exists when code is 0).
Developers can handle the violating segment's audio stream and users based on this value.
Note: This field will return the risk level of the highest risk "Risk Type List" in the 10s audio (e.g., "Political" usually has a higher risk level). The risk level priority of specific "Risk Type Lists" is determined by Shumei's internal moderation system.

  • PASS: Normal content, recommended to pass directly.
  • REVIEW: Suspicious content, recommended for manual review.
  • REJECT: Violating content, recommended to block directly.
AudioText
String
Semantic text corresponding to the 10s audio segment.
AudioUrl
String
URL of the 10s audio segment.
PreAudioUrl
String
Only has value when ReturnPreAudio=1 in the start moderation task request, represents the URL of a 20s audio segment containing the current violating audio segment + the previous audio segment.
RiskDescription
String
Specific "Risk Type List" and subcategories of the highest risk violation content in the current 10s segment.
Will be categorized by detail level into Level 1 tags (e.g., Political), Level 2 tags (e.g., Top Leader), and Level 3 tags (e.g., Top Leader Semantics).
Note: Only for reference when understanding risk reasons, please do not rely on this parameter's value for logical processing.

  • Returns "Normal" when RiskLevel is PASS.
  • Returns custom list name when hitting custom lists.
  • Other cases format: Level1Tag:Level2Tag:Level3Tag.
RiskLabel1
String
Level 1 tag.
Returns "normal" when RiskLevel is PASS.
RiskLabel2
String
Level 2 tag.
Level 2 tags belong to Level 1 tags, empty when riskLevel is PASS.
RiskLabel3
String
Level 3 tag.
Level 3 tags belong to Level 2 tags, empty when riskLevel is PASS.
VadStatus
Number
Audio segment silence status:

  • 0: Silent segment. When silent, other field values will be empty, subject to actual callback content.
  • 1: Non-silent segment.
RiskDetail
Object
Risk details.
Will show the highest risk information in the 10s segment. For example, if the current 10s segment hits both "Pornography" and "Political" "Risk Type Lists", and the backend determines "Political" has higher risk than "Pornography", then "Political" related risk details will be returned.
RiskSource
Number
Risk source:

  • 1000: No risk.
  • 1001: Audio semantics.
  • 1003: Audio features (e.g., pitch, timbre, voiceprint, melody, etc.).
AudioText
String
Text transcribed from 10s audio semantics.
MatchedLists
Array of Object
Custom lists hit (configured by contacting technical support).
Name
String
Custom list name.
RiskInfoList
Array of Object
List of all risk information in the 10s audio segment.
Sorted by Shumei's internally defined risk level priority from high to low.
RiskLevel
Number
Risk level (exists when code is 0).
Developers can handle the violating segment's audio stream and users based on this value.

  • PASS: Normal content, recommended to pass directly.
  • REVIEW: Suspicious content, recommended for manual review.
  • REJECT: Violating content, recommended to block directly.
RiskDescription
String
Specific "Risk Type List" and subcategories of the highest risk violation content in the current 10s segment.
Will be categorized by detail level into Level 1 tags (e.g., Political), Level 2 tags (e.g., Top Leader), and Level 3 tags (e.g., Top Leader Semantics).
Note: Only for reference when understanding risk reasons, please do not rely on this parameter's value for logical processing.

  • Returns "Normal" when RiskLevel is PASS.
  • Returns custom list name when hitting custom lists.
  • Other cases format: Level1Tag:Level2Tag:Level3Tag.
RiskLabel1
String
Level 1 tag.
Returns "normal" when RiskLevel is PASS.
RiskLabel2
String
Level 2 tag.
Level 2 tags belong to Level 1 tags, empty when riskLevel is PASS.
RiskLabel3
String
Level 3 tag.
Level 3 tags belong to Level 2 tags, empty when riskLevel is PASS.
RiskDetail
Object
Risk details, will show the highest risk information in the 10s segment.
For example, if the current 10s segment hits both "Pornography" and "Political" "Risk Type Lists", and the backend determines "Political" has higher risk than "Pornography", then "Political" related risk details will be returned.
RiskSource
Number
Risk source:

  • 1000: No risk.
  • 1001: Audio semantics.
  • 1003: Audio features (e.g., pitch, timbre, voiceprint, melody, etc.).
AudioText
String
Text transcribed from 10s audio semantics. Only has value for the highest risk information.
MatchedLists
Array of Object
Custom lists hit (configured by contacting technical support).
Name
String
Custom list name.
BusinessInfoList
Array of Object
List of all business information. If the following fields cannot meet your needs, please contact technical support for adjustments.
BusinessDescription
String
Business tag description in Chinese.
Format is "Level1BusinessTag:Level2BusinessTag:Level3BusinessTag" in Chinese, e.g., Portrait:Portrait Pose:Sitting.
BusinessLabel1
String
Level 1 business tag.
BusinessLabel2
String
Level 2 business tag.
BusinessLabe3
String
Level 3 business tag.
AuxInfo
Object
Auxiliary information.
RoomId
String
Room ID for moderation.
ProcessBeginTime
Number
Time when 10s audio moderation started (13-digit Unix timestamp).
ProcessFinishTime
Number
Time when 10s audio moderation ended (13-digit Unix timestamp).

3.2 Moderation Task Status Callback

When the ReturnFinishInfo parameter in the Start Audio Stream Moderation task is set to 1, a moderation task status callback will be initiated after the audio stream moderation task ends.

Common Parameters Type Description
Event
String
Callback event, returns censor_audio_v2_status for this callback.
AppId
Number
AppID.
Timestamp
Number
Server current time, Unix timestamp (seconds).
Nonce
String
Random number.
Signature
String
Signature.
Business Parameters Type Description
Code
Number
Return code, 0 indicates success.
Message
String
Operation result description.
TaskId
String
Moderation task ID, corresponds to the TaskId returned by Start moderating audio streams.
Status
Number
Moderation status.
0: Moderation ended.
AuxInfo
Object
Auxiliary information.
RoomId
String
Room ID.
CensorStreamTime
Number
Total duration of the stream moderated in this task (unit: seconds).

4 Sample Data

4.1 Moderation Result Callback Example

{
    //Common parameters
    "Event": "censor_audio_v2_result",
    "AppId": 1,
    "Timestamp": 1724743250,
    "Nonce": "7407715855877898783",
    "Signature": "5cc9e67af0ba0c95f99bd73f79a36485f574ad11"
    //Business parameters
    "Code": 0,
    "Message": "success",
    "TaskId": "384a8a77aeb352d3ec8144ab4640cc52",
    "ResultTaskId": "384a8a77aeb352d3ec8144ab4640cc52_2",
    "Detail": {
        "RiskLevel": "REJECT",
        "AudioText": "Example of violating content",
        "AudioUrl": "http://xxxx/POST_AUDIOSTREAM%2FMP3%2F20240606%2F384a8a77aeb352d3ec8144ab4640cc52_2.mp3?Expires=1720269317&OSSAccessKeyId=LTAI5tLsVBxJ8nhyy5gQVW3K&Signature=8JZymbV%2F6Psm72k6S2Xq3Dcrg14%3D",
        "PreAudioUrl": "http://xxxx/POST_AUDIOSTREAM%2FMP3%2F20240606%2F384a8a77aeb352d3ec8144ab4640cc52_2_pre.mp3?Expires=1720269317&OSSAccessKeyId=LTAI5tLsVBxJ8nhyy5gQVW3K&Signature=BKUDNNWPklQldaEMSFOvSts6O84%3D",
        "RiskDescription": "Advertisment",
        "RiskLabel1": "ad",
        "RiskLabel2": "ad",
        "RiskLabel3": "ad",
        "VadStatus": 1,
        "RiskDetail": {
            "RiskSource": 1001,
            "AudioText": "Example of violating content",
            "MatchedLists": null
        }
    },
    "AuxInfo": {
        "RoomId": "room_1",
        "ProcessBeginTime": 1717677317155,
        "ProcessFinishTime": 1717677317554
    }
}

4.2 Moderation Task Status Callback Example

{
    //Common parameters
    "Event": "censor_audio_v2_status",
    "AppId": 1,
    "Timestamp": 1724743250,
    "Nonce": "7407715855877898783",
    "Signature": "5cc9e67af0ba0c95f99bd73f79a36485f574ad11"
    //Business parameters
    "Code": 0,
    "Message": "success",
    "TaskId": "384a8a77aeb352d3ec8144ab4640cc52",
    "Status": 0,
    "AuxInfo": {
        "RoomId": "room_1",
        "CensorStreamTime": 31
    }
}

5 Response

A returned HTTP status code of 2XX (e.g., 200) indicates success, all other responses indicate failure.

6 Callback Retry Strategy

If the ZEGOCLOUD server does not receive a response, or the HTTP status code received by the ZEGOCLOUD server is not 2xx (such as 200), it will retry with intervals of 2s, 4s, 8s, 16s, and 32s respectively. If the retry still fails after an interval of 32s, it will no longer retry.

Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code