"SSML parsing error: 0x8004801c - Wanted data exists" fails with lexicon based on 'fr-CA-SylvieNeural' voice in Azure Speech SDK, but works via Web Portal"

Hugo Machefer 0 Reputation points
2024-09-19T23:04:40.2766667+00:00

Hello,

We are using the microsoft-cognitiveservices-speech-sdk npm module for text-to-speech synthesis in our Node.js application. We have an SSML segment as follows:

<?xml version="1.0"?>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="http://www.w3.org/2001/mstts" xml:lang="fr-CA">
  <voice name="fr-CA-SylvieNeural">
    <lexicon uri="https://.../Lexicons/fra-e29fc852-1210-4af0-ada8-9b819f0ac72b.xml"/>
    <mstts:express-as style="General">
      <prosody rate="1.77" pitch="0%">
        <lang xml:lang="fr-CA">Elle se lève et danse avec l'homme grec <break time="350ms" /> En dansant, elle continue de lancer des regards à Léonard <break time="350ms" /> Celui-ci continue de lui sourir <break time="350ms"/> <break time="200ms" /></lang>
      </prosody>
    </mstts:express-as>
  </voice>
</speak>

also here enclosed as ssml_inclusing_lexicon_tag_FR_CA.xml

When we pass this SSML to AzureTTSSdk.SpeechSynthesizer.speakSsmlAsync(), we encounter the following exception:

{ 
  privResultId: 'F76CA23F911A4DE09509BFAA6E25683B', 
  privReason: 1, 
  privErrorDetails: 'Status(StatusCode="FailedPrecondition", Detail="SSML parsing error: 0x8004801c - Wanted data exists websocket error code: 1007', 
  privProperties: PropertyCollection { privKeys: [ 'CancellationErrorCode' ], privValues: [ 'BadRequestParameters' ] }, 
  privAudioData: undefined, 
  privAudioDuration: undefined 
}

Interestingly, the same SSML works successfully when submitted through the online web interface: Azure Speech PortalUser's image

Could you help us understand why this discrepancy occurs? Thank you for your assistance!

Note: for reference, we found a similar topic here.

Hugo

PS: additionally, we noticed that removing <lexicon uri="https://.../Lexicons/fra-e29fc852-1210-4af0-ada8-9b819f0ac72b.xml"/> from the SSML prevents the error from occurring when calling speakSsmlAsync() API again.

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,737 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 24,465 Reputation points Microsoft Employee
    2024-09-23T06:39:33.4+00:00

    @Hugo Machefer Apologies for the late reply.

    Root Cause: There is a code bug which corrupt our engine when user sending refresh lexicon signal. All request with lexicon tag after it will failed to load lexicon files

    .

    Current update:

    I got a confirmation that this issue is fixed in Canada Central region.

    Please test this again and let me know if you face any issues.

    **

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.