API | Description |
Submits an audio moderation job. | |
Queries the result of the specified audio moderation job. |
QCloudPostAudioRecognitionRequest
) is used to submit an audio moderation job. You can receive the moderation result by setting the callback address or querying by JobId
.QCloudPostAudioRecognitionRequest * request = [[QCloudPostAudioRecognitionRequest alloc]init];// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "dir1/object1".request.object = @"exampleobject";// File regionrequest.regionName = @"regionName";// Bucket name in the format of BucketName-APPIDrequest.bucket = @"examplebucket-1250000000";// Moderation type, such as `porn` (pornography), `terrorist` (terrorism), `politics` (politically sensitive), and `ads` (advertising).// You can select multiple types; for example, `detect-type=porn,ads` indicates to moderate the image for pornographic and advertising information.// You can use multiple parameters together, such as `QCloudRecognitionPorn | QCloudRecognitionTerrorist`.request.detectType = QCloudRecognitionPorn | QCloudRecognitionAds;request.bizType = BizType;request.finishBlock = ^(QCloudPostAudioRecognitionResult * outputObject, NSError *error) {// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudPostAudioRecognitionResult` class};[[QCloudCOSXMLService defaultCOSXML] PostAudioRecognition:request];
let request = QCloudPostAudioRecognitionRequest();// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "dir1/object1".request.object = "exampleobject";// File regionrequest.regionName = "regionName";// Bucket name in the format of BucketName-APPIDrequest.bucket = "examplebucket-1250000000";// Moderation type, such as `porn` (pornography), `terrorist` (terrorism), `politics` (politically sensitive), and `ads` (advertising).// You can select multiple types; for example, `detect-type=porn,ads` indicates to moderate the image for pornographic and advertising information.// You can use multiple parameters together, such as `QCloudRecognitionPorn | QCloudRecognitionTerrorist`.request.detectType = QCloudRecognitionEnum(rawValue: QCloudRecognitionEnum.porn.rawValue | QCloudRecognitionEnum.ads.rawValue)!request.bizType = BizType;request.setFinish { outputObject, error in// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudPostAudioRecognitionResult` class};QCloudCOSXMLService.defaultCOSXML().postAudioRecognition(request);
QCloudGetAudioRecognitionRequest
) is used to query the result of the specified audio moderation job by JobId
.QCloudGetAudioRecognitionRequest * request = [[QCloudGetAudioRecognitionRequest alloc]init];// Bucket name in the format of BucketName-APPIDrequest.bucket = @"examplebucket-1250000000";// File regionrequest.regionName = @"regionName";// The `jobid` returned by the `QCloudPostAudioRecognitionRequest` APIrequest.jobId = @"jobid";request.finishBlock = ^(QCloudAudioRecognitionResult * outputObject, NSError *error) {// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudAudioRecognitionResult` class};[[QCloudCOSXMLService defaultCOSXML] GetAudioRecognition:request];
let request = QCloudGetAudioRecognitionRequest();// Bucket name in the format of BucketName-APPIDrequest.bucket = "examplebucket-1250000000";// File regionrequest.regionName = "regionName";// The `jobid` returned by the `QCloudPostAudioRecognitionRequest` APIrequest.jobId = "jobid";request.setFinish { outputObject, error in// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudAudioRecognitionResult` class}QCloudCOSXMLService.defaultCOSXML().getAudioRecognition(request);
Was this page helpful?