Skip to main 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.

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. Write romanized text the way it’s naturally typed, and keep English words in their standard spelling:
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: 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.
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.

Worked examples

These fields control different parts of generation:
  • language or locale identifies the transcript’s language and optional region. A regional locale selects the matching accent when the voice supports it; otherwise, the voice uses its default accent for that language. Both fields accept language codes such as en and locale codes such as en-GB. Set one, never both.
  • accent overrides locale-based accent selection. It must match one of the voice’s supported accents. Learn more here.
  • normalization sets how dates, times, and numbers are read. Use auto (default), off, or a language or locale code.

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.

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.

Locale codes

Pass a locale code such as en-GB through locale.

When should I use a locale instead of a language?

For Sonic 3.6 and later, use locale. The older language field remains supported for existing integrations. Both accept base language and regional locale codes, but you cannot set both. The value controls regional behavior: en leaves the region unspecified, while en-GB selects a British accent when the voice supports it and uses British text-normalization conventions. If the voice does not support that regional accent, it uses its default English accent. Set normalization separately to override the reading conventions. For example, with a voice that supports a British accent, locale: "en-GB" with normalization: "en-US" selects that accent and reads dates and numbers using US conventions. To override locale-based accent selection, use accent.

Which locales are supported?

You can pass any base language code from Sonic 3.6 language support, or one of these regional locale codes:
Base LanguageSupported Locales
English (en)en-GB, en-US*, en-IN,en-IE,en-ZA,en-NZ,en-SG,en-AU
Spanish (es)es-ES*, es-MX, es-US
French (fr)fr-FR*, fr-CA
Dutch (nl)nl-NL*, nl-BE
Portuguese (pt)pt-PT, pt-BR*
Bulgarian (bg)bg-BG
Bengali (bn)bn-IN
Czech (cs)cs-CZ
Danish (da)da-DK
German (de)de-DE
Greek (el)el-GR
Finnish (fi)fi-FI
Gujarati (gu)gu-IN
Hebrew (he)he-IL
Hindi (hi)hi-IN
Croatian (hr)hr-HR
Hungarian (hu)hu-HU
Indonesian (id)id-ID
Italian (it)it-IT
Japanese (ja)ja-JP
Georgian (ka)ka-GE
Kannada (kn)kn-IN
Korean (ko)ko-KR
Malayalam (ml)ml-IN
Marathi (mr)mr-IN
Malay (ms)ms-MY
Norwegian (no)no-NO
Odia (or)or-IN
Punjabi (pa)pa-IN
Polish (pl)pl-PL
Romanian (ro)ro-RO
Russian (ru)ru-RU
Slovak (sk)sk-SK
Swedish (sv)sv-SE
Tamil (ta)ta-IN
Telugu (te)te-IN
Thai (th)th-TH
Tagalog (tl)tl-PH
Turkish (tr)tr-TR
Ukrainian (uk)uk-UA
Urdu (ur)ur-IN
Vietnamese (vi)vi-VN
Chinese (zh)zh-CN
If you pass a base language code for English, Spanish, French, Dutch, or Portuguese, Cartesia uses the locale marked with an asterisk (*) above.

Turning normalization off

Setting normalization to "off" skips automatic normalization. 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. Note that explicit tags and other input validation still work with normalization off: Normalization is set at the request level. 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.