Skip to content

Commit 0c063f5

Browse files
committed
语音接口升级
1 parent 9227d6b commit 0c063f5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

aip/censor/ContentCensorClient.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const __imageCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/
2626

2727
const __textCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined"
2828

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"
3030

3131
const __videoCensorUserDefinedUrl = "https://aip.baidubce.com/rest/2.0/solution/v1/video_censor/v2/user_defined"
3232

@@ -78,10 +78,11 @@ func (client *ContentCensorClient) ImgCensorUrl(imgUrl string, options map[strin
7878
return baseClient.PostUrlForm(__imageCensorUserDefinedUrl, data, &client.auth)
7979
}
8080

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) {
8282
data := make(map[string]string)
8383
data["url"] = url
8484
data["fmt"] = fmt
85+
data["rate"] = strconv.FormatInt(int64(rate), 10)
8586
for key, val := range options {
8687
switch val := val.(type) {
8788
case bool:
@@ -91,10 +92,11 @@ func (client *ContentCensorClient) VoiceCensorUrl(url string, fmt string, option
9192
return baseClient.PostUrlForm(__voiceCensorUserDefinedUrl, data, &client.auth)
9293
}
9394

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) {
9596
data := make(map[string]string)
9697
data["base64"] = base64
9798
data["fmt"] = fmt
99+
data["rate"] = strconv.FormatInt(int64(rate), 10)
98100
for key, val := range options {
99101
switch val := val.(type) {
100102
case bool:

0 commit comments

Comments
 (0)