question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Chinese lexicon is not adopted by SpeakSsmlAsync

See original GitHub issue

Describe the bug In Chinese, a word could have different pronunciation based on the context, so I created a custom lexicon to correct the pronunciation. The lexicon file is stored in Azure storage and can be accessed in public, the url is embedded in the ssml content correctly, generate auto with the SpeakSsmlAsyml method, there is no change to the audio

To Reproduce Steps to reproduce the behavior:

  1. Create a SpeechSynthesizer instance with following configuration VoiceName = “zh-CN-YunzeNeural”, Language = “zh-CN”,
  2. Call SpeakSsmlAsync using var result = await synthesizer.SpeakSsmlAsync(ssml); with following SSML content.
<speak xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="http://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" version="1.0" xml:lang="zh-CN" >
<voice name="zh-CN-YunzeNeural">
<lexicon uri="https://matrixreader.blob.core.windows.net/public/lexicon.xml" />
任我行冷笑道, 剑指小腹,这个小姑娘。姊姊还好吗?
任我行大声道:你们这些人,都是我的手下败将,还不束手就擒!
</voice>
</speak>
  1. Save the audio content to a file
  2. Listen to the audio, the word “任我行” has different pronunciation.
  3. Also tested my lexicon file in the Speech Studio, the pronunciation is correct. So it could be something wrong in SDK.

Expected behavior Expect the the lexicon is adopted by sdk and pronunciation is correct.

Version of the Cognitive Services Speech SDK Version 1.27.0

Platform, Operating System, and Programming Language

  • OS: Windows 11 Pro 22H2
  • Hardware - x64,
  • Programming language: C#

Additional context

  • there is no error message

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:32 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jiajzhancommented, Jul 17, 2023

Hi @AndrewLang I am on vacation previous days. For this: " if there are words seems not supported or well recognized, then it cause the whole lexicon file not adopted", it’s correct. If one word is set a wrong pronunciation, the whole lexicon won’t work.

1reaction
jiajzhancommented, Jun 28, 2023

Region should not be the problem, I will share my code soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · Azure-Samples/cognitive-services-speech-sdk
beamforming StartAngle and EndAngle not working? ... Custom Chinese lexicon is not adopted by SpeakSsmlAsync in-review In review service-side issue ...
Read more >
Text-To-Speech files in Studio not using custom lexicon file
In the last few days I've discovered that my custom lexicon file is not being used during TTS preview in Speech Studio or...
Read more >
TTS Custom Lexicon is not applied
I am trying to apply a custom lexicon to the Text-to-Speech service. Here is my lexicon file: <?xml version="1.0" encoding="UTF-8"?>
Read more >
SpeakSsmlAsync Method - Microsoft Speech Platform SDK ...
To synchronously speak a string that contains SSML markup, use the SpeakSsml(String) method. You can use SpeakAsync(String) to initiate the asynchronous ...
Read more >
Azure Cognitive Services TTS custom lexicon isn't firing
I am trying to apply a custom lexicon to the en-US voice just like in Azure's tutorial, here's my ssml.xml:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found