gpt4 book ai didi

javascript - Azure SpeechSynthesizer 错误 HTTP : not supported. 预期 HTTPS:NPM `microsoft-cognitiveservices-speech-sdk`

转载 作者:行者123 更新时间:2023-12-03 03:45:32 44 4
gpt4 key购买 nike

我正在使用 microsoft-congnitiveservices-speech-sdk npm 包,一切运行良好。但我现在随机收到一个错误。要么因浏览器更新或次要软件包更新而中断(?)

'Unable to contact server. StatusCode: 500, undefined Reason: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"'

我已尝试从本地开发 HTTP 服务器以及使用 HTTPS 保证安全的生产站点进行尝试。有什么想法或解决方案可以解决 microsoft-congnitiveservices-speech-sdk 问题吗?

import * as Azure from "microsoft-cognitiveservices-speech-sdk";

const speechConfig = Azure.SpeechConfig.fromSubscription(SPEECH_KEY, SPEECH_REGION);
speechConfig.speechSynthesisOutputFormat = Azure.SpeechSynthesisOutputFormat.Audio48Khz192KBitRateMonoMp3;

const synthesizer = new Azure.SpeechSynthesizer(speechConfig);

const ssml = `
<speak version="1.0" xmlns="https://www.w3.org/2001/10/synthesis" xml:lang="en-US">
<voice name="en-US-JennyNeural">
<prosody volume="85" pitch="medium" rate="1">
<break time="1.5s" /> ${text}
</prosody>
</voice>
</speak>
`

try {
synthesizer.speakSsmlAsync(
ssml,
result => {
synthesizer.close();
console.log('RESULT', result)
resolve(result);
},
error => {
synthesizer.close();
console.log('ERROR', error)
if(error) throw Error(error)
});
}
catch(err) {
console.log(err)
throw(err)
}

最佳答案

对我来说,这个问题与 Sentry 集成有关。更多信息请点击:https://github.com/microsoft/cognitive-services-speech-sdk-js/issues/458

到目前为止,问题似乎还没有解决。

关于javascript - Azure SpeechSynthesizer 错误 HTTP : not supported. 预期 HTTPS:NPM `microsoft-cognitiveservices-speech-sdk`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69348985/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com