Skip to main content
How you format input text directly affects audio quality. These rules cover numbers, dates, mixed-language text, special characters, and chunking for long content.

Language and Script Guidelines

Mixed Language Formatting

When working with mixed language content, particularly English and Hindi, proper script selection is crucial for accurate processing:
  • English text must be written in Latin script
  • Hindi text must be written in Devanagari script
  • Avoid transliteration of Hindi words into Latin script
Examples:

Proper Nouns Handling

For Indian proper nouns, maintain cultural and linguistic accuracy by following these rules:
  1. City Names:
    • Use Devanagari script for Indian city names
    • Maintain Latin script for non-Indian city names
  2. Personal Names:
    • Use Devanagari script for Indian personal names
    • Maintain original script for non-Indian names
Examples:

Text Chunking

Character Limit Guidelines

To optimize real-time processing and reduce latency, implement these chunking practices:
  1. Size Constraints:
    • Maximum chunk size: 250 characters
    • Break at natural punctuation points
    • Maintain sentence coherence when possible
  2. Breaking Points Priority:
    • First priority: Sentence-ending punctuation (., !, ?)
    • Second priority: Other punctuation (;, :)
    • Third priority: Natural word breaks

Chunking Implementation

Use the following Python code for implementing text chunking:
  • For lightning-large model, set max_chunk_size=140.
  • For lightning model, set max_chunk_size=250.

Handling numbers

Order IDs and Large Numbers

When handling order IDs or large numbers:
  • Send them as separate requests
  • Split the text around the number
Example:

Phone Numbers

Default Grouping

  • Numbers are automatically grouped in 3-4-3 format
  • Example: “9876543210” is read as “987-6543-210”

Custom Formatting

For specific reading patterns:
  • Format numbers explicitly in text
  • Write out the exact pronunciation desired
Example:

Date and Time Formatting Guidelines

Date Formats

You may use any of the following formats when writing dates:
  1. DD/MM/YYYY → 12/02/2025 → “twelve, two, twenty twenty-five”
  2. DD-MM-YYYY → 12-02-2025 → “twelve, two, twenty twenty-five”
  3. DD Month YYYY → 12 February 2025 → “twelve February twenty twenty five”
  4. Month DD YYYY → February 12th 2025 → “February, twelfth, twenty twenty-five”
  5. DD-MM-YY → 12-02-25 → “twelve, two, twenty-five”
  6. DD/MM/YY → 12/02/25 → “twelve, two, twenty-five”
Note: Ordinal suffixes (st, nd, rd, th) could be used in dates.

Time Formats

You may use the following formats when specifying time:
  1. HH:MM:SS → 14:30:15 → “fourteen thirty fifteen”
  2. HH:MM → 14:30 → “fourteen thirty”

Mathematical Expressions

Express mathematical operations in words for clarity. For complex mathematical expressions, break down into simpler components:

Approximate Values

When expressing approximate values:
  • Write out the full words
  • Avoid using symbols for approximation
  • Be explicit about the approximation
Examples:

Units and Measurements

When expressing measurements, write out the units in full words to ensure clear understanding:

Symbols and Special Characters

Basic Symbols

Spell out special characters and symbols in all contexts:

Digital Content Formatting

1. URLs:
2. Email Addresses:
3. Social Media:

Range and Interval Notation

Always write out ranges and relationships explicitly to avoid ambiguity:
Note:
  • Consistency is key - use the same format throughout your content
  • When in doubt, write out the full words
  • For complex URLs or handles, break them into smaller, manageable chunks
  • Avoid using symbols that could have multiple interpretations

Code-Switching (Lightning v3.1)

Lightning v3.1 supports real-time intra-session language switching via two mutually exclusive language groups. Each group shares a unified phoneme space, enabling seamless mid-utterance transitions between member languages without session re-initialization. Cross-group switching is not supported within a single session.

Language Groups

Indic Group. Optimized for South Asian language pairs with English as the bridging language. Global Group. Optimized for European language pairs with English and Hindi as bridging languages. Intra-group switching is unrestricted. Any language within the same group can be interleaved at the token level. Cross-group switching (e.g., Tamil from Indic + French from Global) is architecturally unsupported and will produce undefined behavior.
en and hi exist in both groups. All other languages are exclusive to one group. The group is determined at session initialization based on the first non-shared language encountered. Design your session’s language set accordingly.

Routing Examples

Multi-Lingual Voice Cloning

  • Source language selection. Provide reference audio in the primary target language. Voice characteristics (timbre, pitch, cadence) transfer cross-lingually within the same group, but phonetic accuracy is highest when the source and target languages match.
  • Script encoding. Input text must use native script for each language (Devanagari for Hindi/Marathi/Gujarati, respective Brahmic scripts for Dravidian languages, Latin for European languages). Transliterated input degrades synthesis quality.
  • Cross-lingual accent drift. Cloned voices may exhibit accent drift when synthesizing languages other than the source. For accent-sensitive applications, provide reference audio in each target language separately.
  • Group constraint. Cloned voices follow the same group routing rules. A session initialized in the Indic group cannot switch to Global-exclusive languages, regardless of the voice’s source language.