Skip to content

Commit 762cfef

Browse files
author
廖拓
committed
新增 扩展语音审核能力
1 parent b39c269 commit 762cfef

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/AipContentCensor.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const METHOD_POST = 'POST';
3232

3333
const PATH_USER_DEFINED_IMAGE = '/rest/2.0/solution/v1/img_censor/v2/user_defined';
3434
const PATH_USER_DEFINED_TEXT = '/rest/2.0/solution/v1/text_censor/v2/user_defined';
35+
const PATH_USER_DEFINED_VOICE = '/rest/2.0/solution/v1/voice_censor/v2/user_defined';
3536

3637
const PATH_REPORT = '/rpc/2.0/feedback/v1/report';
3738

@@ -93,6 +94,26 @@ class AipImageCensor extends BaseClient {
9394
return this.commonImpl(param);
9495
}
9596

97+
voiceCensorUserDefined(voice, type, fmt, options) {
98+
let param = { fmt };
99+
if (type === 'url') {
100+
param.url = voice;
101+
}
102+
if (type === 'base64') {
103+
param.base64 = voice;
104+
}
105+
if (options) {
106+
if (options.rawText) {
107+
param.rawText = options.rawText
108+
}
109+
if (options.split) {
110+
param.split = options.split
111+
}
112+
}
113+
param.targetPath = PATH_USER_DEFINED_VOICE;
114+
return this.commonImpl(param);
115+
}
116+
96117
report(feedback) {
97118
let param = {};
98119
param.feedback = feedback;
@@ -101,4 +122,4 @@ class AipImageCensor extends BaseClient {
101122
}
102123
}
103124

104-
module.exports = AipImageCensor;
125+
module.exports = AipImageCensor;

0 commit comments

Comments
 (0)