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 Portal
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.