## TL;DR

The situation: I created a custom lexicon to fix Chinese pronunciations and reference it in my SSML with SpeakSsmlAsync, but the pronunciation does not change at all. What actually fixes it (verified in the thread): A few things can make the whole lexicon get silently ignored.

## Steps

1. I created a custom lexicon to fix Chinese pronunciations and reference it in my SSML with SpeakSsmlAsync, but the pronunciation does not change at all. The lexicon works in Speech Studio with the same content, so the file itself seems fine. I even waited overnight after editing the lexicon in case it needed time to propagate, and it still made no difference.

2. What actually fixes it (verified in the thread):

3. A few things can make the whole lexicon get silently ignored. First, when the lexicon content changes it takes at least 15 minutes before the service picks up the new file, so retest after waiting. Second, and this is the big one: if even one word in the lexicon has a wrong pronunciation, the entire lexicon wont be applied. The error message does not tell you that, so validate your file with the custom lexicon validation tool on the Cognitive-Speech-TTS samples repo and remove or fix bad entries one by one. Also make sure you use the sapi alphabet when writing pinyin. Once I cleaned up the bad entries the lexicon worked as expected. Source: https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/1981

## When to use

You are seeing this: The lexicon works in Speech Studio with the same content, so the file itself seems fine. Use this skill when you run into "Azure custom Chinese lexicon ignored by SpeakSsmlAsync".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Edge cases

- Also make sure you use the sapi alphabet when writing pinyin.

## Sources

- https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/1981
