Reputation: 532
I am using the microsoft-congnitiveservices-speech-sdk npm package and things have been working fine. But randomly I am getting an error now. Either broke with browser update or minor package update(?)
'Unable to contact server. StatusCode: 500, undefined Reason: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"'
I have tried from both a local dev HTTP server, as well as a production site that is secure with HTTPS. Any thoughts or solutions to solve what is being the microsoft-congnitiveservices-speech-sdk issue?
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)
}
Upvotes: 1
Views: 668
Reputation: 1
For me, the issue was related to Sentry integration. More info here: https://github.com/microsoft/cognitive-services-speech-sdk-js/issues/458
So far seems like issue is not resolved.
Upvotes: 0