Speech services - audio content creation - lexicons

Gruber, Lukáš 0 Reputation points
2025-08-13T09:24:04.4433333+00:00

HI All, I was working on text to speech (audio content creation). I created a text file, apply my customized lexicon (that used to work), but when I was previewing the file, meaning listening to it before file export, lexicon wasnt applied at all. Rules that I have in lexicon (such as how to read abbreviations etc...) were not executed. Did you came across similar issues? Thank you in advance for any reply, Best Regards. Lukas

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 36,716 Reputation points Volunteer Moderator
    2025-08-25T18:14:36.4566667+00:00

    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.

    0 comments No comments

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.