feat(app): update
This commit is contained in:
@ -75,7 +75,7 @@ func TransAudioToText(fileUrl string) (result string, err error) {
|
||||
fmt.Println("录音文件识别请求失败,Http错误码: ", postResponse.GetHttpStatus())
|
||||
return
|
||||
}
|
||||
var postMapResult map[string]interface{}
|
||||
var postMapResult map[string]any
|
||||
err = json.Unmarshal([]byte(postResponseContent), &postMapResult)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@ -111,7 +111,7 @@ func TransAudioToText(fileUrl string) (result string, err error) {
|
||||
fmt.Println("识别结果查询请求失败,Http错误码:", getResponse.GetHttpStatus())
|
||||
break
|
||||
}
|
||||
var getMapResult map[string]interface{}
|
||||
var getMapResult map[string]any
|
||||
err = json.Unmarshal([]byte(getResponseContent), &getMapResult)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@ -120,11 +120,11 @@ func TransAudioToText(fileUrl string) (result string, err error) {
|
||||
if statusText == STATUS_RUNNING || statusText == STATUS_QUEUEING {
|
||||
time.Sleep(10 * time.Second)
|
||||
} else if statusText == STATUS_SUCCESS {
|
||||
var resResult = getMapResult[KEY_RESULT].(map[string]interface{})
|
||||
fmt.Println("result:", resResult["Sentences"].([]interface{}))
|
||||
ss := resResult["Sentences"].([]interface{})
|
||||
var resResult = getMapResult[KEY_RESULT].(map[string]any)
|
||||
fmt.Println("result:", resResult["Sentences"].([]any))
|
||||
ss := resResult["Sentences"].([]any)
|
||||
for _, seg := range ss {
|
||||
item := seg.(map[string]interface{})
|
||||
item := seg.(map[string]any)
|
||||
result += item["Text"].(string)
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user