use of com.qcloud.cos.model.ciModel.auditing.AudioAuditingRequest in project cos-java-sdk-v5 by tencentyun.
the class AudioAuditingJobDemo method describeAudioAuditingJob.
/**
* describeAudioAuditingJob 接口用于创建音频审核任务。
*
* @param client
*/
public static void describeAudioAuditingJob(COSClient client) throws InterruptedException {
// 1.创建任务请求对象
AudioAuditingRequest request = new AudioAuditingRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("demo-123456789");
request.setJobId("sa9175bc451c4b11ecb3fa5254009*****");
while (true) {
// 3.调用接口,获取任务响应对象
AudioAuditingResponse response = client.describeAudioAuditingJob(request);
String state = response.getJobsDetail().getState();
if ("Success".equalsIgnoreCase(state) || "Failed".equalsIgnoreCase(state)) {
System.out.println(response.getRequestId());
System.out.println(response.getJobsDetail());
// 4.根据业务逻辑进行处理结果,此处工具类处理操作仅供参考。
List<AuditingInfo> auditingInfoList = AuditingResultUtil.getAuditingInfoList(response.getJobsDetail());
System.out.println(auditingInfoList);
break;
}
Thread.sleep(100);
}
}
use of com.qcloud.cos.model.ciModel.auditing.AudioAuditingRequest in project cos-java-sdk-v5 by tencentyun.
the class AudioAuditingJobDemo method createAudioAuditingJobs.
/**
* createImageAuditingJob 接口用于创建音频审核任务。
*
* @param client
*/
public static void createAudioAuditingJobs(COSClient client) {
// 1.创建任务请求对象
AudioAuditingRequest request = new AudioAuditingRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("demo-123456789");
// request.getInput().setObject("pron.mp3");
request.getInput().setObject("pron.mp3");
request.getInput().setDataId("TestDataId");
request.getConf().setDetectType("all");
request.getConf().setCallback("http://cloud.tencent.com/");
// 3.调用接口,获取任务响应对象
AudioAuditingResponse response = client.createAudioAuditingJobs(request);
System.out.println(response);
}
Aggregations