Hello
I notice an impossibility to use the "text to speech" service since at least Wednesday, May 4, from 3pm.
My last successful use was on Tuesday, May 2, 23:29 (French time).
I use in all my programs a code similar to the one attached below (partially anonymous key here with XXX).
Modejs environment as a console application or web API:
«
(function() {
"use strict";
/***DEBUG
*
*
* curl -v -X POST "https://francecentral.api.cognitive.microsoft.com/sts/v1.0/issuetoken" -H "Ocp-Apim-Subscription-Key: 5d9bdc5da0304409929bc787e1a44087" -H "Content-type: application/x-www-form-urlencoded" -H "Content-Length: 0"
*
*
*/
var sdk = require("microsoft-cognitiveservices-speech-sdk");
var readline = require("readline");
var audioFile = "YourAudioFile.wav";
// This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
const speechConfig = sdk.SpeechConfig.fromSubscription("5d9bdc5dXXXXX", "francecentral");
const audioConfig = sdk.AudioConfig.fromAudioFileOutput(audioFile);
// The language of the voice that speaks.
speechConfig.speechSynthesisVoiceName = "en-US-JennyNeural";
// Create the speech synthesizer.
var synthesizer = new sdk.SpeechSynthesizer(speechConfig, audioConfig);
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question("Enter some text that you want to speak >\n> ", function (text) {
rl.close();
// Start the synthesizer and wait for a result.
synthesizer.speakTextAsync(text,
function (result) {
if (result.reason === sdk.ResultReason.SynthesizingAudioCompleted) {
console.log("synthesis finished.");
} else {
console.error("Speech synthesis canceled, " + result.errorDetails +
"\nDid you set the speech resource key and region values?");
}
synthesizer.close();
synthesizer = null;
},
function (err) {
console.trace("err - " + err);
synthesizer.close();
synthesizer = null;
});
console.log("Now synthesizing to: " + audioFile);
});
}());
»
the result when calling the endpoint is always the same, including in the SSML call version:
«
Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 401
SpeechSynthesisResult {
privResultId: 'F9C152F0F9414887BB913EDEDD181E5A',
privReason: 1,
privAudioData: undefined,
privErrorDetails: 'Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 401',
privProperties: PropertyCollection {
privKeys: [ 'CancellationErrorCode' ],
privValues: [ 'ConnectionFailure' ]
}
}
»
I saw this problem simultaneously in several applications using the same resource "SethSpeech (Speech Recognition Services). And the problem appeared simultaneously on my production environments and on my development machine, on Wednesday, May 3rd, around 3 p.m. I I hadn't made any code changes, or my configuration on the azure portal since the previous day or all my production applications and on my development machine were still functional.
I specify that the limit of my azure plan was far from being reached (start of cycle)
I tried the following resolutions:
1°) Uninstalling and reinstalling the npm package microsoft-cognitiveservices-speech-sdk
In different versions previously running on my environments including 1.13, 1.27.0 and 1.28.0
2°) repeatedly reset keys in the azure portal
3°) creation of a new resource from scratch “sethSpeech2”
In any case, a curl confirmed that I was using the correct speech_key and speech_region
However, in all cases, the code executed: synthesizer.speakTextAsync(
Systematically sent me a: “Speech synthesis canceled, Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 401”
I've locked everything approaching I could find on the web and here, but nothing that can fix the problem that seems directly related to a call mismatch using npm microsoft-cognitiveservices-speech -sdk
Should a particular SDK version be preferred to restore service via modejs?
If anyone has a solution..?
Sincerely, Seth