|
@@ -1,17 +1,13 @@
|
|
package main
|
|
package main
|
|
|
|
|
|
import (
|
|
import (
|
|
- util "app.yhyue.com/moapp/jybase/common"
|
|
|
|
- "app.yhyue.com/moapp/jybase/mysql"
|
|
|
|
"flag"
|
|
"flag"
|
|
"fmt"
|
|
"fmt"
|
|
- "github.com/robfig/cron"
|
|
|
|
- asr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/asr/v20190614"
|
|
|
|
- "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
|
|
|
|
- "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
|
|
|
|
- "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
|
|
|
|
"log"
|
|
"log"
|
|
- "time"
|
|
|
|
|
|
+
|
|
|
|
+ "app.yhyue.com/moapp/jybase/common"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/mysql"
|
|
|
|
+ "github.com/robfig/cron"
|
|
)
|
|
)
|
|
|
|
|
|
var (
|
|
var (
|
|
@@ -23,42 +19,8 @@ var (
|
|
|
|
|
|
func main() {
|
|
func main() {
|
|
flag.Parse()
|
|
flag.Parse()
|
|
- util.ReadConfig(&cfg)
|
|
|
|
- credential := common.NewCredential(
|
|
|
|
- cfg.KeyId,
|
|
|
|
- cfg.Key,
|
|
|
|
- )
|
|
|
|
- cpf := profile.NewClientProfile()
|
|
|
|
- cpf.HttpProfile.Endpoint = "asr.tencentcloudapi.com"
|
|
|
|
- client, _ = asr.NewClient(credential, "ap-guangzhou", cpf)
|
|
|
|
- defer util.Catch()
|
|
|
|
- request := asr.NewCreateRecTaskRequest()
|
|
|
|
- request.EngineModelType = common.StringPtr("8k_zh")
|
|
|
|
- request.ChannelNum = common.Uint64Ptr(1)
|
|
|
|
- request.SpeakerDiarization = common.Int64Ptr(1)
|
|
|
|
- request.SpeakerNumber = common.Int64Ptr(2)
|
|
|
|
- request.ResTextFormat = common.Uint64Ptr(0)
|
|
|
|
- request.SourceType = common.Uint64Ptr(0)
|
|
|
|
- //request.Url = common.StringPtr(util.ObjToString(data["MonitorFilename"]))
|
|
|
|
- request.Url = common.StringPtr("https://storage.7x24cc.com/storage-server/presigned/ss1/a6-online-work-phone-record/workPhoneRecord/20250224/20250224151935_18595503318_177****8064_dab6d83a-5011-4019-b7c9-2771b5d26a84.mp3")
|
|
|
|
- response, err := client.CreateRecTask(request)
|
|
|
|
- log.Println(response)
|
|
|
|
- if _, ok := err.(*errors.TencentCloudSDKError); ok {
|
|
|
|
- <-ch
|
|
|
|
- fmt.Printf("An API error has returned: %s", err)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- taskId := response.Response.Data.TaskId
|
|
|
|
- requestss := asr.NewDescribeTaskStatusRequest()
|
|
|
|
- log.Println("任务id ", *taskId)
|
|
|
|
- requestss.TaskId = taskId
|
|
|
|
- r, errs := client.DescribeTaskStatus(requestss)
|
|
|
|
- log.Println("查询结果======", r.ToJsonString(), errs)
|
|
|
|
- if _, oks := errs.(*errors.TencentCloudSDKError); oks {
|
|
|
|
- fmt.Printf("An API error has returned: %s", errs)
|
|
|
|
- time.Sleep(time.Duration(cfg.WaitingTime) * time.Second)
|
|
|
|
- }
|
|
|
|
- log.Println("cfg ", r)
|
|
|
|
|
|
+ common.ReadConfig(&cfg)
|
|
|
|
+ log.Println("cfg ", cfg)
|
|
//
|
|
//
|
|
ch = make(chan bool, cfg.Chan)
|
|
ch = make(chan bool, cfg.Chan)
|
|
//
|
|
//
|