> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cartesia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced capabilities

> Use Hinglish code-switching and text normalizers to control how Sonic speaks specialized content.

Sonic handles most transcripts as-is. The capabilities below cover cases where you want finer control over mixed-language speech and how written forms are spoken.

## Hinglish

Sonic supports code-switching between Hindi and English (Hinglish) in a single generation. Pass the transcript in conventional written form — Devanagari, Latin script, or a mix — and the model switches languages naturally mid-sentence.

```python theme={null}
from cartesia import Cartesia

client = Cartesia(api_key="your-api-key")
response = client.tts.generate(
    model_id="sonic-preview",
    transcript="आपका order confirm हो गया है। Delivery expected by Friday.",
    voice="a0e99841-438c-4a64-b679-ae501e7d6091",
    language="hi",
)
audio = response.read()
```

### Romanized Hindi and Indic text

Sonic reads Hindi and other Indic languages written in Latin script — Hinglish and other transliterated text — and follows romanized transcripts materially better in Sonic 3.6, available on `sonic-preview` now.

Write romanized text the way it's naturally typed, and keep English words in their standard spelling:

```text theme={null}
Aapka order confirm ho gaya hai. Delivery kal shaam tak hogi.
```

Set the `language` field to the language of the transcript (`hi` for Hinglish) even when the text is romanized.

Quality varies with how scripts are mixed in the transcript:

| Script mix                     | Example                            | `language`    | `normalization` |
| ------------------------------ | ---------------------------------- | ------------- | --------------- |
| Pure Devanagari                | `आपका ऑर्डर आ गया है।`             | `hi`          | `hi-IN`         |
| Pure English                   | `Your order has arrived.`          | `en` or `hi`  | `en-IN`         |
| Pure romanized Hindi           | `Aapka order aa gaya hai.`         | `hi`          | `en-IN`         |
| Romanized Hindi + English      | `Aapka order confirm ho gaya hai.` | `hi`          | `en-IN`         |
| Devanagari + English loanwords | `आपका order confirm हो गया है।`    | `hi`          | `hi-IN`         |
| Devanagari + romanized Hindi   | `आपका order aa gaya hai.`          | Not supported | —               |
| All three scripts              | `आपका order confirm ho gaya है।`   | Not supported | —               |

For pure English transcripts, either `en` or `hi` works as the language: the more Indian words the sentence carries — names, places, product terms — the more the `hi` setting pronounces them correctly.

<Tip>
  Experiment with these settings to find what sounds best for your content. Both `language` and `normalization` are set per generation, so you can vary them transcript by transcript rather than picking one combination for your whole integration.
</Tip>

### Worked examples

Accent and reading conventions are independent controls: `locale` picks the voice's accent, `normalization` picks how dates, times, and numbers are read.

#### Hindi voice, English digit reading

An OTP or confirmation code inside a Hindi transcript should read digit-by-digit the English way: `4821` as "four eight two one" rather than as a Hindi number.

```json theme={null}
{
  "model_id": "sonic-preview",
  "transcript": "आपका OTP 4821 है।",
  "voice": "a0e99841-438c-4a64-b679-ae501e7d6091",
  "locale": "hi",
  "normalization": "en-IN",
  "output_format": { "container": "mp3", "sample_rate": 44100, "bit_rate": 128000 }
}
```

#### Romanized Hindi with English read-outs

The highest-traffic combination: a Hinglish transcript spoken with a Hindi-Indian accent while dates, times, and digits follow English-Indian conventions.

```json theme={null}
{
  "model_id": "sonic-preview",
  "transcript": "Aapka order 14/08/2026 ko deliver hoga, confirmation code 4821 hai.",
  "voice": "a0e99841-438c-4a64-b679-ae501e7d6091",
  "locale": "hi-IN",
  "normalization": "en-IN",
  "output_format": { "container": "mp3", "sample_rate": 44100, "bit_rate": 128000 }
}
```

## Normalizers

Normalizers control how Sonic expands written forms — numbers, currency, dates, phone numbers — into spoken words. By default, Sonic applies locale-aware normalization automatically, so `$19.99` is spoken as "nineteen dollars and ninety-nine cents".

```python theme={null}
response = client.tts.generate(
    model_id="sonic-preview",
    transcript="Your total is $19.99, due 04/20/2025.",
    voice="a0e99841-438c-4a64-b679-ae501e7d6091",
)
# Spoken: "Your total is nineteen dollars and ninety-nine cents, due April twentieth, twenty twenty-five."
```

See [Prompting tips](/build-with-cartesia/capability-guides/prompting-tips) for the written forms Sonic normalizes today, and pre-normalization as a fallback for edge cases.

<Note>
  Documentation for configuring individual normalizers is coming soon.
</Note>

### Regional reading conventions

Today, `en-GB` and `en-US` produce identical normalization output: English and Hindi are excluded from the locale-aware normalization engine, so all English regional variants inherit the same reading conventions. The `locale` and `normalization` fields make regional differentiation expressible.

If British-specific read-outs matter for your product today, pre-normalize the forms that differ (dates, currency) and see [turning normalization off](#turning-normalization-off).

### Turning normalization off

Setting `normalization` to `"off"` skips the automatic normalizer — and only the automatic normalizer. Everything else still applies:

* [SSML tags](/build-with-cartesia/capability-guides/ssml-tags) and [generation controls](/build-with-cartesia/capability-guides/volume-speed-emotion)
* [Pronunciation dictionaries](/build-with-cartesia/capability-guides/custom-pronunciations)
* Transcript buffering
* Input validation: potentially malicious character sequences may be blocked for security and stability reasons

Turn it off when you pre-normalize text yourself, need a custom read-out for a symbol (for example, `#` as "number"), or need all-caps words spoken as words rather than spelled out letter by letter.

Normalization is all-or-nothing per request — there is no per-span control. If most of a transcript should be normalized but one span shouldn't, write out that span as it should be spoken (along with any other written forms in the transcript that would have needed normalizing) and send the request with normalization off.

### Normalizer worked examples

#### Pre-normalized text with the normalizer off

For "teleprompter" transcripts you've already written out the way they should be spoken, custom symbol read-outs, or all-caps words that should be spoken as words:

```json theme={null}
{
  "model_id": "sonic-preview",
  "transcript": "Your total is nineteen dollars and ninety-nine cents.",
  "voice": "a0e99841-438c-4a64-b679-ae501e7d6091",
  "locale": "en",
  "normalization": "off",
  "output_format": { "container": "mp3", "sample_rate": 44100, "bit_rate": 128000 }
}
```

Only the automatic normalizer is skipped — see [turning normalization off](#turning-normalization-off) for exactly what still applies.

#### British accent with US reading conventions

The decoupling pattern itself: pick the accent with `locale`, pick the reading conventions with `normalization`.

```json theme={null}
{
  "model_id": "sonic-preview",
  "transcript": "Your appointment is on 03/04/2026.",
  "voice": "62ae83ad-4f6a-430b-af41-a9bede9286ca",
  "locale": "en-GB",
  "normalization": "en-US",
  "output_format": { "container": "mp3", "sample_rate": 44100, "bit_rate": 128000 }
}
```

This reads with a British accent and US conventions (`03/04/2026` as March fourth). Note that today the reverse isn't distinguishable — see [regional reading conventions](#regional-reading-conventions): `en-GB` and `en-US` normalization output is currently identical, so this pattern matters as regional differentiation lands rather than changing read-outs today.

#### Different read-out conventions inside one transcript

A single request applies one `normalization` value to the whole transcript — there is no per-span control, because detecting language switches inside a transcript would add latency to every request.

If one clause needs Hindi read-outs and another needs English read-outs, split the transcript and send two requests with different `normalization` values and the **same voice**, so the accent stays consistent, then concatenate the audio:

```json Request 1 theme={null}
{
  "model_id": "sonic-preview",
  "transcript": "Aapki appointment 15 tareekh ko hai.",
  "voice": "a0e99841-438c-4a64-b679-ae501e7d6091",
  "locale": "hi-IN",
  "normalization": "hi-IN",
  "output_format": { "container": "raw", "encoding": "pcm_s16le", "sample_rate": 44100 }
}
```

```json Request 2 theme={null}
{
  "model_id": "sonic-preview",
  "transcript": "Please arrive by 2:30 PM on 08/15/2026.",
  "voice": "a0e99841-438c-4a64-b679-ae501e7d6091",
  "locale": "hi-IN",
  "normalization": "en-IN",
  "output_format": { "container": "raw", "encoding": "pcm_s16le", "sample_rate": 44100 }
}
```

On the [WebSocket API](/api-reference/tts/websocket), raw PCM chunks from consecutive generations can be concatenated directly.
