When a text-to-speech (TTS) engine mispronounces your company name or a key technical term, it can undermine the user's trust and sound unprofessional. A TTS pronunciation dictionary, also known as a lexicon, is a powerful tool for fixing these errors. It allows you to create custom rules that tell the TTS engine exactly how to say specific words.

This guide explains how these dictionaries work and provides a practical framework for correcting common pronunciation issues.

Key takeaways

  • A pronunciation dictionary, or lexicon, lets you manually override a TTS engine's default pronunciation to fix misspoken words like brand names, acronyms, and technical jargon.
  • You can fix words using either phoneme-based rules (specifying sounds with a phonetic alphabet) or simpler alias-based rules (swapping one word's spelling for another's).
  • The syntax for rules and supported phonetic alphabets are specific to each TTS provider; rules are not universally portable across different systems.
  • Always test your fixes within full sentences. Context, stress, and surrounding words can all affect the final audio output.

What is a TTS pronunciation dictionary?

A TTS pronunciation dictionary is a custom mapping that overrides a text-to-speech engine’s default pronunciation for certain words. It connects a written word, called a grapheme, to a specific desired pronunciation. This lets you ensure brand names, proper nouns, and domain-specific jargon are spoken correctly and consistently every time.

Most TTS systems rely on a Grapheme-to-Phoneme (G2P) model. A G2P model is an algorithm that predicts a word's pronunciation based on its spelling (Source name). However, English spelling is notoriously inconsistent. Words like "read" can be pronounced differently depending on context, and G2P models often struggle with words they haven't seen before, such as new brand names or foreign loanwords.

A pronunciation dictionary acts as an exception list. Before the TTS engine sends a word to its G2P model, it first checks your custom dictionary. If it finds the word, it uses your specified pronunciation and skips the G2P prediction entirely. This gives you precise control over critical terminology. You can learn more about this process in our overview of How Does Text-to-Speech Work? The Full Pipeline.

How pronunciation overrides work: The synthesis pipeline

A TTS engine follows a specific order of operations to determine a word's pronunciation. Your custom lexicon is just one step in this pipeline. Understanding this hierarchy helps you predict and debug how the engine will behave. While details can vary, the general process follows these steps (Source name).

  1. Text Normalization: The engine first cleans the raw input text. It expands abbreviations, converts numbers to words (e.g., "10" to "ten"), and standardizes punctuation. It then splits the cleaned text into a sequence of tokens, which are typically words or punctuation marks.
  2. Inline Override Check: The engine looks for inline pronunciation tags, such as the <phoneme> tag in Speech Synthesis Markup Language (SSML). These tags provide a pronunciation for a single instance of a word and have the highest priority. If an SSML tag is present, it is always used (Source name).
  3. Custom Lexicon Lookup: If there is no inline override, the engine consults the custom pronunciation dictionary you provided. If it finds a matching entry for the token, it uses your custom pronunciation.
  4. Built-in Lexicon Lookup: If the word isn't in your custom lexicon, the engine checks its own internal, general-purpose dictionary. This dictionary contains standard pronunciations for tens of thousands of common words in the language.
  5. G2P Fallback: If the word is not found in any lexicon, it is considered an "out-of-vocabulary" (OOV) word. The engine then passes the word to its Grapheme-to-Phoneme (G2P) model, which generates the most likely pronunciation based on spelling patterns.

How do you fix a mispronounced brand name? (A worked example)

Let’s say you have a fictional brand named "Synthify," but your TTS engine pronounces it "Sin-THIGH-fie" instead of the desired "SIN-tiff-eye." You can use a TTS pronunciation dictionary to correct this. Here is a step-by-step process.

Step 1: Isolate the problem token

First, confirm the exact text token being sent to the TTS engine. In this case, it's the seven-letter string "Synthify". Be mindful of variations like "Synthify's" or "Synthify!" which may be treated as different tokens and require their own dictionary entries.

Step 2: Choose your correction method

You have two primary methods for specifying the correct pronunciation in a lexicon: an alias or a phoneme entry (Source name).

  • An alias maps the problematic word to a different, simpler word or spelling that the TTS engine already knows how to say correctly.
  • A phoneme entry maps the word to a specific sequence of sounds using a phonetic alphabet.

To decide which to use, ask: Does the desired pronunciation sound like another common word or a simple respelling? If yes, an alias is easier. If the sound is unique or needs high precision, use phonemes.

Step 3: Create the dictionary entry

The exact syntax depends on your TTS provider, but the concept is universal.

Method 1: Alias Entry An alias is the simplest approach. You find a word or a creative spelling that produces the right sound. For "Synthify," the respelling "Sintiffy" might work well.

JSON
{
  "Synthify": {
    "alias": "Sintiffy"
  }
}

Illustrative JSON-like structure

Method 2: Phoneme Entry This method offers maximum control. You must provide the pronunciation using a phonetic alphabet supported by your engine, such as the International Phonetic Alphabet (IPA). For "SIN-tiff-eye," the IPA transcription would be sɪntɪfaɪ.

JSON
{
  "Synthify": {
    "phoneme": {
      "alphabet": "ipa",
      "transcription": "sɪntɪfaɪ"
    }
  }
}

Illustrative JSON-like structure

You must use the specific phonetic symbols your TTS provider documents. Using standard IPA symbols from a chart may not work if the engine expects a different format or character set (Source name).

Step 4: Test in context

Finally, synthesize a few full sentences containing the word "Synthify" to ensure the correction sounds natural. Listen for awkward pauses or unnatural emphasis around the word. A word that sounds perfect in isolation can sometimes sound jarring in a sentence.

Phoneme vs. Alias: Which override should you use?

Choosing between a phoneme-based entry and a simple alias involves a trade-off between precision and simplicity. A phoneme entry gives you direct, granular control over the sound, while an alias relies on the TTS engine's existing knowledge.

Here is a comparison to help you decide which approach is right for your situation.

Attribute Phoneme Entry Alias Entry
Precision High. You define the exact sequence of sounds, giving you complete control over vowels, consonants, and stress. Variable. Relies on the TTS engine's G2P model to pronounce your alias correctly. The result may be close but not perfect.
Ease of Use Low. Requires knowledge of phonetic alphabets like IPA or X-SAMPA. Finding the correct transcription and syntax for your engine can be difficult. High. Easy to create and understand. You just need to find a simpler word or creative spelling that sounds right.
When to Use Use for words with unique sounds not found in the language, names with non-intuitive pronunciations, or when an alias provides an inaccurate result. Use for acronyms (e.g., "NASA" aliased to "nassa"), simple respellings of names (e.g., "Leigh" to "Lee"), or when you need a quick and easy fix.
Common Pitfalls Using an unsupported phonetic alphabet or incorrect symbols. Forgetting to mark primary stress, which can lead to a flat, robotic pronunciation. The alias itself is mispronounced or has multiple pronunciations (e.g., aliasing "live" could result in two different sounds). The alias sounds unnatural in context.

What are the common mistakes and limits of pronunciation dictionaries?

While powerful, pronunciation dictionaries are not a magic bullet. They have specific limitations, and users often fall into common traps that prevent their rules from working as expected.

  • Using unsupported phoneme symbols. Always consult your TTS provider's documentation for the specific phonetic alphabet (e.g., IPA, ARPAbet) and symbol set it supports. Copying a transcription from a generic IPA chart may not work.
  • Forgetting word variations. A rule for "Synthify" will not match "Synthify's," "synthify," or "Synthified." You must create separate entries for each grammatical form of the word you want to correct.
  • Testing words in isolation. A word can sound different depending on the words that come before and after it. Always test your overrides in full, representative sentences to check the flow and rhythm.
  • Confusing pronunciation with prosody. Lexicons define what sounds to say, not how to say them. They do not control pitch, speaking rate, or volume. For that, you need to use a tool like SSML. For more details, see our guide to SSML prosody.
  • Assuming portability. A lexicon file created for one TTS provider will likely fail with another. Each provider has its own syntax, supported phoneme sets, and matching logic.

Troubleshooting: Why is my pronunciation rule being ignored?

It can be frustrating when you've carefully crafted a pronunciation rule and the TTS engine seems to ignore it. If your override isn't working, run through this diagnostic checklist.

  1. Check for Exact Matching: Is your rule case-sensitive? Many systems require an exact match. Does the word in your text have punctuation attached (like "Synthify.") that isn't in your lexicon entry? The token must match your rule's key precisely (Source name).
  2. Verify Tokenization: How does the TTS engine "see" your input? For example, is "state-of-the-art" treated as one token or four? Some systems let you see the tokenized output, which can reveal mismatches between your rule and the actual token.
  3. Confirm Phoneme Alphabet and Syntax: If using a phoneme entry, double-check that every symbol is part of the alphabet supported by your engine. A single invalid character can cause the entire rule to be ignored.
  4. Check Rule Precedence: Could another rule be taking priority? An inline SSML <phoneme> tag in your input text will always override a custom lexicon entry. Check your input text for any competing overrides.
  5. Verify Language and Voice: Pronunciation rules are typically specific to a language and sometimes even a particular voice. Ensure your lexicon is applied to the correct language code (e.g., "en-US") and that you have tested it with the specific voice you are using. If you work with mixed-language text, you may need different rules for different contexts, a challenge we cover in our post on Multilingual TTS: Why Voices Break on Mixed-Language Text.

What to learn next

Sources and further reading