File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const METHOD_POST = 'POST';
3232
3333const PATH_USER_DEFINED_IMAGE = '/rest/2.0/solution/v1/img_censor/v2/user_defined' ;
3434const 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
3637const 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 ;
You can’t perform that action at this time.
0 commit comments