语音翻译端点是谁? [英] Whwer is the speech translation endpoint?
问题描述
我想使用语音翻译API将一个音频数据转换为另一种语言音频数据.
I want to use speech translation api to trans one audio data to another language audio data.
我阅读了文档,但只找到了使用SDK进行翻译的方法.
I read the document ,but I only found the way by using SDK to translate.
我想用http或websocket自己控制它,谁知道服务器的url和终结点在哪里.
I want to use http or websocket to control it by myself, Who knows where is the servers url and endpoint.
https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-translation
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-translation
以下是我的代码
headers := make(map[string][]string, 0)
headers["Content-type"] = append(headers["Content-type"], "application/x-www-form-urlencoded")
headers["Content-Length"] = append(headers["Content-Length"], "0")
headers["Ocp-Apim-Subscription-Key"] = append(headers["Ocp-Apim-Subscription-Key"], key)
//checkurl := "https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken"
checkurl := "https://api.cognitive.microsoft.com/sts/v1.0/issueToken"
u := "wss://dev.microsofttranslator.com/speech/translate?from=en-US&to=zn-CH&api-version=1.0"
log.Printf("connecting to %s", u)
//uuid
u1 := uuid.Must(uuid.NewV4())
log.Println(u1)
uid := strings.Replace(u1.String(), "-", "", -1)
log.Println(uid)
//get header
headers := make(map[string][]string, 0)
headers["Authorization"] = append(headers["Authorization"], "Bearer "+token)//token getting by key
headers["X-ConnectionId"] = append(headers["X-ConnectionId"], uid)
c, _, err := websocket.DefaultDialer.Dial(u, headers)
推荐答案
Hi,
有关Speech API的问题,请在此论坛上发布您的问题:
For questions on the Speech API, pls post your questions on this forum:
此致,
Jaya
Regards,
Jaya
这篇关于语音翻译端点是谁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!