Documentation Index

Fetch the complete documentation index at: https://docs.knovvu.com/llms.txt

Use this file to discover all available pages before exploring further.

Customization for Synthesis Accuracy

Prev Next

Abbreviation management allows you to define custom pronunciations for specific terms in the TTS system. When an abbreviation is encountered in the input text, the engine expands it into the defined form before synthesizing speech - resulting in natural-sounding output instead of letter-by-letter spelling.

tts-abbreviation-how-it-works.png


Scope: Voice-specific vs. Language-specific

Abbreviations can be scoped to a specific voice or to an entire language. Understanding the difference is important before adding entries.

  • Voice-specific abbreviations apply only to the voice they are added for. For example, adding "ASAP" for the voice "Jennifer" will only affect output from Jennifer - other voices are unaffected.
  • Language-specific abbreviations apply to all voices using that language. For example, adding "ETA" for en-US means every voice using American English will expand it, regardless of which voice is selected.

1. Adding Abbreviations

By voice name

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'Content-Type: application/json' \
--data '{
    "voice-name": "Jennifer",
    "abbreviations": [
        {"AI": "artificial intelligence"},
        {"NASA": "National Aeronautics and Space Administration"}
    ]
}'
Parameter Description
voice-name The voice this abbreviation applies to
abbreviations List of abbreviation-to-expansion pairs

By language code

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'Content-Type: application/json' \
--data '{
    "language": "en-US",
    "abbreviations": [
        {"AI": "artificial intelligence"},
        {"NASA": "National Aeronautics and Space Administration"}
    ]
}'
Parameter Description
language The language code this abbreviation applies to (e.g. en-US)
abbreviations List of abbreviation-to-expansion pairs

2. Retrieving Abbreviations

By language

Retrieves all abbreviations associated with a language code. All voices using this language will apply the returned abbreviations.

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'language: en-US' \
--data ''

By voice name

Retrieves all abbreviations added specifically for a given voice.

curl --location '{{ManagementAddress}}/v1/speech/synthesis/abbreviations' \
--header 'voice-name: Jennifer' \
--data ''

Example response

{
    "abbreviation-count": 2,
    "abbreviations": [
        {
            "abbreviation": "fomo",
            "expansion": "fear of missing out",
            "id": 11,
            "language": "",
            "tenant": "default",
            "voice-name": "Jennifer"
        },
        {
            "abbreviation": "asap",
            "expansion": "as soon as possible",
            "id": 12,
            "language": "",
            "tenant": "default",
            "voice-name": "Jennifer"
        }
    ]
}
Field Description
abbreviation-count Total number of abbreviations returned
abbreviation The abbreviated term
expansion The full phrase the abbreviation maps to
id Unique identifier for the abbreviation entry
language Language scope - empty if voice-specific
tenant Tenant context (default: "default")
voice-name Voice scope - empty if language-specific

3. Deleting an Abbreviation

To delete an abbreviation, use its unique id in the request URL.

curl --location --request DELETE '{{ManagementAddress}}/v1/speech/synthesis/abbreviations/12'

The id can be obtained from the retrieve response above.


Before and After

tts-abbreviation-before-after.png


Notes

  • Abbreviations are managed per voice-name or language - choose the scope that matches your use case.
  • If both a voice-specific and a language-specific abbreviation exist for the same term, voice-specific takes precedence.
  • Ensure correct authentication headers are included in all requests if required by your deployment.
  • When deleting, use the id returned by the retrieve endpoint - not the abbreviation text itself.