1 Star 0 Fork 0

网易易盾 / yidun-golang-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
audio_async_check_demo.go 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"fmt"
"log"
"os"
"time"
"github.com/yidun/yidun-golang-sdk/yidun/service/antispam/audio"
request2 "github.com/yidun/yidun-golang-sdk/yidun/service/antispam/audio/check/async/v4/request"
)
// 音频异步检测demo
func main() {
YourBusinessId := os.Getenv("BUSINESS_ID")
YourSecretId := os.Getenv("SECRET_ID")
YourSecretKey := os.Getenv("SECRET_KEY")
// 设置易盾内容安全分配的businessId
request := request2.NewAudioAsyncCheckRequest(YourBusinessId)
request.SetExtLon1(99)
request.SetExtLon2(88)
request.SetExtStr1("extStr1")
request.SetExtStr2("extStr2")
// 实例化一个 Client,入参需要传入易盾内容安全分配的secretId,secretKey
client := audio.NewAudioClientWithAccessKey(YourSecretId, YourSecretKey)
// 设置 url
request.SetURL("http://xxx.mp4?time=1700213386514")
request.SetUniqueKey(time.Now().String())
checkResponse, err := client.AsyncCheckAudio(request)
if err != nil {
// 处理错误并打印日志
log.Fatal(err)
}
if checkResponse.GetCode() == 200 {
data := checkResponse.Result
fmt.Println("taskId:", *data.TaskId)
fmt.Println("dealingCount", *data.DealingCount)
} else {
fmt.Println("error code: ", checkResponse.GetCode())
fmt.Println("error msg: ", checkResponse.GetMsg())
}
}
Go
1
https://gitee.com/netease_yidun/yidun-golang-sdk.git
git@gitee.com:netease_yidun/yidun-golang-sdk.git
netease_yidun
yidun-golang-sdk
yidun-golang-sdk
main

搜索帮助