@@ -26,7 +26,7 @@ const __imageCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/
26
26
27
27
const __textCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined"
28
28
29
- const __voiceCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/v1/voice_censor/v2 /user_defined"
29
+ const __voiceCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/v1/voice_censor/v3 /user_defined"
30
30
31
31
const __videoCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/v1/video_censor/v2/user_defined"
32
32
@@ -78,10 +78,11 @@ func (client *ContentCensorClient) ImgCensorUrl(imgUrl string, options map[strin
78
78
return baseClient .PostUrlForm (__imageCensorUserDefinedUrl , data , & client .auth )
79
79
}
80
80
81
- func (client * ContentCensorClient ) VoiceCensorUrl (url string , fmt string , options map [string ]interface {}) (result string ) {
81
+ func (client * ContentCensorClient ) VoiceCensorUrl (url string , rate int , fmt string , options map [string ]interface {}) (result string ) {
82
82
data := make (map [string ]string )
83
83
data ["url" ] = url
84
84
data ["fmt" ] = fmt
85
+ data ["rate" ] = strconv .FormatInt (int64 (rate ), 10 )
85
86
for key , val := range options {
86
87
switch val := val .(type ) {
87
88
case bool :
@@ -91,10 +92,11 @@ func (client *ContentCensorClient) VoiceCensorUrl(url string, fmt string, option
91
92
return baseClient .PostUrlForm (__voiceCensorUserDefinedUrl , data , & client .auth )
92
93
}
93
94
94
- func (client * ContentCensorClient ) VoiceCensor (base64 string , fmt string , options map [string ]interface {}) (result string ) {
95
+ func (client * ContentCensorClient ) VoiceCensor (base64 string , rate int , fmt string , options map [string ]interface {}) (result string ) {
95
96
data := make (map [string ]string )
96
97
data ["base64" ] = base64
97
98
data ["fmt" ] = fmt
99
+ data ["rate" ] = strconv .FormatInt (int64 (rate ), 10 )
98
100
for key , val := range options {
99
101
switch val := val .(type ) {
100
102
case bool :
0 commit comments