logo
Video Call
Server API
Stream Mixing and Transcoding APIs
On this page

StartCensorAudioV2

POST

https://rtc-api.zego.im/

Audio stream moderation is an interactive extension service of ZEGOCLOUD's real-time audio/video products. Through the audio stream moderation API, developers can invoke 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 audio stream moderation callback or a configured custom callback URL. The start audio stream moderation feature should be used in conjunction with the stop audio stream moderation feature.

Warning

Before using this API, please refer to Console - Cloud Market - Shumei Content Moderation and follow the on-page instructions to enable the relevant permissions for Shumei Content Moderation.

Rate Limit
For all rooms under the same AppID: 100 times/second

FAQ

  1. What happens if I start audio/video stream moderation API but don't call the stop audio/video stream moderation API?

    It will automatically end after pulling an empty stream for about 5 minutes. It is recommended to actively call the API to end moderation when you finish moderating.

  2. How do I identify which stream violated the rules in the audio/video stream moderation result callback?

    After completing moderation, ShuMei will return multiple callbacks based on 10s audio segment AudioUrls. The current results do not directly expose streamID information, but you can obtain it by extracting information from resultTaskId.

    Example (assuming streamID is 0001, you can see that AudioUrl contains streamID 0001):

Request

Query Parameters

    Action stringrequired

    Possible values: [StartCensorAudioV2]

    API prototype parameters

    https://rtc-api.zego.im?Action=StartCensorAudioV2

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.

    Timestamp int64required

    💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.

    Signature stringrequired

    💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

Body

required
    RoomId stringrequired

    Room ID of the audio moderation to be performed. 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 published by trusted users), please set 'ZegoPulisherConfig.streamCensorshipFlag' to not allow moderation when calling the client SDK's 'startPublishingStream' to publish streams.

    EventId stringrequired

    Scenario identifier. Use this parameter to identify the scenario corresponding to the audio stream. Moderation policies can be adjusted based on scenarios, thereby achieving control over moderation strictness for different scenarios.

    • Live streaming: live_streaming
    • Audio chat room: audio_room
    • 1v1: private_chat

    If the above optional values cannot fully meet your requirements, please contact ZEGOCLOUD Technical Support.

    ResultCallbackUrl string

    Custom callback URL for moderation results. If you need to send moderation results for this moderation task through another callback URL, you can use this parameter. If not needed, you can configure a unified callback URL in the ZEGOCLOUD Console. For details, please refer to Console - Cloud Market - Shumei Content Moderation.

    StatusCallbackUrl string

    Custom callback URL for moderation status. If you need to send moderation status for this moderation task through another callback URL, you can use this parameter. If not needed, you can configure a unified callback URL in the ZEGOCLOUD backend. For details, please refer to Console - Cloud Market - Shumei Content Moderation.

    IsMixingEnabled int32

    Possible values: [0, 1]

    Default value: 0

    Whether to submit for moderation through stream mixing:

    • 0: Default value, do not mix streams for moderation, i.e., single stream moderation. Each audio stream in the room is moderated independently.
    • 1: Mix streams for moderation, all audio streams in the room are mixed into one stream.

    Mixed stream moderation can save audio moderation costs, but correspondingly makes it difficult to accurately identify violating streams and users. Please choose the appropriate moderation method based on your actual business situation.

    AudioLanguage stringrequired

    Possible values: [zh, ja, ko, th, vi, ms, tl, id, hi, ar, tr, en, es, pt, it, fr, de, ru]

    Audio stream language. When you need to recognize the semantics of the audio stream, please pass 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 string[]required

    Possible values: >= 1

    Risk type list. At least one of RiskTypeList and BusinessTypeList must not be empty. Values that can be added to the array are as follows:

    Audio semantics:

    • ADLAW: Violation of advertising law
    • EROTIC: Pornography
    • DIRTY: Abuse
    • POLITY: Politics
    • BAN: Prohibited
    • VIOLENT: Violence/Terrorism
    • ADVERT: Advertisement

    Audio features:

    • MOAN: Moaning
    • ANTHEN: National anthem recognition
    • BANDAUDIO: Prohibited songs
    • AUDIOPOLITICAL: For details, please contact ZEGOCLOUD Technical Support
    BusinessTypeList string[]

    Business recognition category.

    At least one of RiskTypeList and BusinessTypeList must not be empty. Values that can be added to the array are as follows:

    Audio semantics:

    • MOINIR: Minors

    Audio features:

    • SING: Singing
    • LANGUAGE: Language recognition
    • VOICE: Voice attribute recognition

    Audio stream recognition is not limited to violating content, but can also assist developers in business operations. If the above optional values cannot meet your business requirements, please contact ZEGOCLOUD Technical Support.

    LabelLanguage string

    Possible values: [zh, en]

    Language type of labels in callback information (Label related):

    • zh: Chinese
    • en: English
    ReturnAllText int32

    Possible values: [0, 1]

    Default value: 0

    Whether to return all text of the current 10s segment. The risk levels of moderation results will be divided into the following three categories:

    PASS: Normal content, recommended to allow directly.

    REVIEW: Suspicious content, recommended for manual review.

    REJECT: Violating content, recommended to block directly.

    • 0: Return audio segment text with risk level other than pass (default)
    • 1: Return audio segment text of all risk levels
    ReturnPreText int32

    Possible values: [0, 1]

    Default value: 0

    Whether to return the semantics of the previous segment of the violating segment:

    • 0: Do not return the text of the previous segment of the violating segment
    • 1: Return the text of the previous segment of the violating segment
    ReturnPreAudio int32

    Possible values: [0, 1]

    Default value: 0

    Whether to return the previous audio segment link of the violating segment:

    • 0: Do not return the previous audio segment link of the violating segment, only return the violating segment audio link (default)
    • 1: Return the previous audio segment link of the violating segment
    ReturnFinishInfo int32

    Possible values: [0, 1]

    Default value: 0

    When the moderation task ends, whether to perform a "moderation task status" callback:

    • 0: Do not send end notification when moderation ends
    • 1: Send end notification when moderation ends

Responses

Success
Schema
    Code int32

    Return code. The following only lists some return codes related to the API business logic. For complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionSuggested Action
    50006、50007HTTP request failed.Please retry later (recommended 300s), or contact ZEGOCLOUD Technical Support.
    50009Moderation failed.Please retry later (recommended 300s), or contact ZEGOCLOUD Technical Support.
    50117Configuration error, ShuMei permissions not enabled.Please refer to Console - Cloud Market - Shumei Content Moderation and follow the on-page instructions to enable ShuMei content moderation permissions.
    Message string

    Operation result description

    RequestId string

    Request ID

    Data object
    Response data
    TaskId string

    Moderation task ID, used to end the moderation task

Previous

MediaThumbnails

Next

StopCensorAudioV2

On this page

Back to top