Hello Lucas !
Thank you for posting on Microsoft Learn.
I saw many people reporting the same behavior you , and it’s usually one of 3 things:
- the lexicon isn’t actually being applied to the synthesis request
- the request path you’re using doesn’t support lexicon
- there’s a mismatch (locale / syntax) that causes the lexicon to be ignored
The old Long Audio API does not support the <lexicon> element so you may need to use the Batch synthesis API (GA) or the normal real-time TTS endpoint instead. If your preview / export path silently routed to Long Audio, your lexicon rules will be ignored. It is better to switch to Batch synthesis for long content.
https://learn.microsoft.com/en-us/azure/ai-services/speech-service/migrate-to-batch-synthesis
You need to reference the lexicon explicitly in SSML (don’t rely only on the UI picker) .
Even if you select a lexicon in ACC, you need to add an explicit <lexicon>
tag so you’re sure the engine loads it:
<speak version="1.0" xml:lang="en-US"
xmlns="http://www.w3.org/2001/10/synthesis">
<lexicon uri="https://speech.microsoft.com/portal/.../file/<LEXICON_ID>?fileKind=CustomLexiconFile"/>
<voice name="en-US-GuyNeural">BTW should follow my lexicon.</voice>
</speak>
To get <LEXICON_ID>
, open the lexicon in ACC and copy the ID from the file URL (just before ?fileKind=CustomLexiconFile
)
https://learn.microsoft.com/en-us/azure/ai-services/speech-service/faq-tts
You can always use PLS 1.0 to validate the lexicon file itself with the correct namespace and the right locale for your voice.