Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.95k stars 1.86k forks source link

StatusCode="FailedPrecondition", Detail="Voice does not match" #1616

Closed MichalWysockiLeonardo closed 2 years ago

MichalWysockiLeonardo commented 2 years ago

Hi We deployed the Cognitive Services container and trying to convert text to speech using SpeechSDK.

Our code: var speechConfig = SpeechConfig.FromHost(new Uri("ws://localhost:5000"));

using (var speechSynthesizer = new SpeechSynthesizer(speechConfig)) { var speechSynthesisResult = await speechSynthesizer.SpeakSsmlAsync(Ssml);

OutputSpeechSynthesisResult(speechSynthesisResult, Ssml);

}

SSML:

Welcome to Microsoft Cognitive Services Text-to-Speech API.

We get the following error:

Connection was closed by the remote host. Error code: 1007. Error details: Status(StatusCode="FailedPrecondition", Detail="Voice does not match") USP state: 3. Received audio size: 0 bytes.

Do you know what is causing this error?

Regards, Mike

chschrae commented 2 years ago

Hi there,

I would guess that the voice specified in the speechConfig or the ssml doesn't exist. Could you share the ssml you are using?

Is there anywhere that you are setting the voice to use?

glecaros commented 2 years ago

Hi @MichalWysockiLeonardo, were you able to verify if a voice is being set like @chschrae suggested?

pankopon commented 2 years ago

Ref. https://docs.microsoft.com/azure/cognitive-services/speech-service/speech-container-faq?tabs=stt#could-you-explain-these-errors-from-the-custom-speech-to-text-container- Error 2: "Voice does not match."

You need to provide the correct voice name in the request, which is case-sensitive. Refer to the full service name mapping.

pankopon commented 2 years ago

Closed as answered, please open a new issue if more support is needed.