tencent cloud

Cloud Infinite

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Product Overview
Product Strengths
Use Cases
Feature Overview
Regions and Domains
Specifications and Limits
Billing
Billing Overview
Billing Mode
Billable Items
Free Tier
Payment Overdue
Viewing Bill Details
FAQs
Getting Started
Registering and Logging In
Bind Bucket
Uploading and Processing File
Downloading and Deleting Images
Unbinding Buckets
Using CI via COS
Features
Image Processing
Media Processing
Content Moderation
AI Content Recognition
File Processing
Smart Voice
File processing
User Guide
Overview
Bucket Management
Smart Toolbox
Job and Workflow
Data Monitoring
Usage statistics
Use Cases
Copyright Protection Solutions
Image Processing Practices
Working with API Authorization Policies
Workflow Practices
API Documentation
API Overview
Structure
Common Request Headers
Common Response Headers
Activate Vast Service
Image Processing
AI-Based Content Recognition
Smart Audio
Media Processing
Content Moderation
Document Processing
File Processing
Job and Workflow
Cloud Virus Detection
Error Codes
Request Signature
SDK Documentation
SDK Overview
Android SDK
iOS SDK
COS Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Go SDK
COS iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
Mini Program SDK
Personal Information Protection Policy for SDK
Security and Compliance
Permission ‍Management
FAQs
Basic Settings
Document Processing
Media Processing
Content Recognition
Smart Audio
Agreements
Service Level Agreement
Contact Us
Glossary

Audio Moderation

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-03-04 10:32:42

Overview

This document describes how to use the content moderation feature provided by Cloud Infinite (CI). CI fully integrates the processing capabilities with the COS SDK.
Note:
To use the content moderation service, you need to have the permission to use CI:
For root accounts, click here for role authorization.
This document provides an overview of APIs and SDK code samples for audio moderation.
API
Operation
Description
Submitting an audio moderation job
Submits an audio moderation job.
Querying the audio moderation job result
Queries the result of the specified audio moderation job.

SDK API References

For the parameters and method descriptions of all the APIs in the SDK, see SDK API Reference.

Submitting an Audio Moderation Job

Feature description

This API is used to submit an audio moderation job.
Note:
The COS Android SDK version should not be earlier than v5.8.7.

Sample code

// Bucket name in the format of BucketName-APPID
String bucket = "examplebucket-1250000000";
// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "dir1/object1".
String cosPath = "dir1/exampleobject.mp3";
// URL of the audio. Either `Object` or `Url` can be selected at a time.
String url = "https://myqcloud.com/%205Audio.mp3";
PostAudioAuditRequest request = new PostAudioAuditRequest(bucket);
request.setObject(cosPath);
request.setUrl(url);
// Set the original content, which can contain up to 512 bytes. This field will be returned in the response as-is.
request.setDataId("DataId");
// Callback address, which must start with `http://` or `https://`.
request.setCallback("https://github.com");
// Structure of the callback content. Valid values: `Simple` (the callback content contains basic information), `Detail` (the callback content contains detailed information). Default value: `Simple`.
request.setCallbackVersion("Detail");
// The scene to be moderated, such as `Porn` (pornography) and `Ads` (advertising). You can pass in multiple types and separate them by comma, such as `Porn,Ads`.
request.setDetectType("Porn,Ads");

// `CIService` is a subclass of `CosXmlService` and has the same initialization method as it.
ciService.postAudioAuditAsync(request, new CosXmlResultListener() {
@Override
public void onSuccess(CosXmlRequest request, CosXmlResult cosResult) {
// `result` is the result of the submitted audio moderation job.
// For detailed fields, see the API documentation or SDK source code.
PostAuditResult result = (PostAuditResult) cosResult;
}

@Override
public void onFail(CosXmlRequest request, CosXmlClientException clientException, CosXmlServiceException serviceException) {
if (clientException != null) {
clientException.printStackTrace();
} else {
serviceException.printStackTrace();
}
}
});
Note:
For more complete samples, visit GitHub.

Querying Audio Moderation Job Result

Feature description

This API is used to query the result of an audio moderation job.
Note:
The COS Android SDK version should not be earlier than v5.8.7.

Sample code

// Bucket name in the format of BucketName-APPID
String bucket = "examplebucket-1250000000";
// Moderation job ID
String jobId = "iab1ca9fc8a3ed11ea834c525400863904";
GetAudioAuditRequest request = new GetAudioAuditRequest(bucket, jobId);
// `CIService` is a subclass of `CosXmlService` and has the same initialization method as it.
ciService.getAudioAuditAsync(request, new CosXmlResultListener() {
@Override
public void onSuccess(CosXmlRequest request, CosXmlResult cosResult) {
// `result` is the result of the audio moderation job.
// For detailed fields, see the API documentation or SDK source code.
GetAudioAuditResult result = (GetAudioAuditResult) cosResult;
}

@Override
public void onFail(CosXmlRequest request, CosXmlClientException clientException, CosXmlServiceException serviceException) {
if (clientException != null) {
clientException.printStackTrace();
} else {
serviceException.printStackTrace();
}
}
});
Note:
For more complete samples, visit GitHub.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan