【问题标题】:Azure SpeechSynthesizer Error HTTP: not supported. Expected HTTPS: NPM `microsoft-cognitiveservices-speech-sdk`Azure SpeechSynthesizer 错误 HTTP:不支持。预期的 HTTPS:NPM `microsoft-cognitiveservices-speech-sdk`
【发布时间】:2022-01-04 12:21:48
【问题描述】:

我正在使用 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)
}

【问题讨论】:

  • 大家好,我是微软 TTS 团队的工程师 Yulin。这么晚才回复很抱歉。您的代码看起来不错并且错误消息很奇怪,因为 SDK 将始终尝试使用 https 或 wss 端点。你能分享我的小复制,以便我可以帮助调试吗?
  • 我也有同样的问题,这个消息突然出现,没有代码/依赖改变

标签: javascript node.js azure npm azure-cognitive-services


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2019-06-22
    • 1970-01-01
    • 2020-10-27
    • 2020-09-13
    • 1970-01-01
    • 2018-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多