How to clone across languages

View as Markdown

Sarvam’s voice cloning model is cross-lingual: the language of the reference clip does not have to match the language of the synthesized output. You can clone an English voice and have it speak Hindi, or a Tamil reference drive Bengali output - the model preserves the speaker’s timbre and identity while applying the phonetics and prosody of the target language.

How it works

There is no source-language parameter. The model infers the speaker’s characteristics from ref_audio alone, and language_code decides only the language of the output:

# English reference clip, Hindi output
curl -s -X POST "https://api.sarvam.ai/voices/clone" \
-H "api-subscription-key: $SARVAM_API_KEY" \
-F "text=नमस्ते, मैं आपकी कैसे मदद कर सकता हूँ?" \
-F "language_code=hi-IN" \
-F "ref_audio=@english_speaker.wav" \
-F "ref_text=Hello, this is a sample reference recording."

The reference clip’s language is never declared, so the same clip can drive outputs in every supported language. See Supported Languages for the full list.

Why ref_text matters more here

ref_text is optional - when omitted, the API transcribes the reference clip automatically. But for cross-lingual generation, providing the actual transcript improves alignment and naturalness of the cloned output, especially when the reference and target languages differ.

# The transcript should match what is actually spoken in the clip
curl -s -X POST "https://api.sarvam.ai/voices/clone" \
-H "api-subscription-key: $SARVAM_API_KEY" \
-F "text=नमस्ते, मैं आपकी कैसे मदद कर सकता हूँ?" \
-F "language_code=hi-IN" \
-F "ref_audio=@english_speaker.wav" \
-F "ref_text=Hello, this is a sample reference recording."

Tips for cross-lingual cloning

Speaker accent transfers

A speaker with a strong regional accent in the reference will retain a hint of that accent in the cloned output. This is usually desirable - it preserves the speaker’s identity. If you want a more neutral target-language accent, pick a reference clip from a speaker with less pronounced source-language inflection.

Script differences don’t matter

The text field accepts native scripts (Devanagari, Tamil, Bengali, etc.) or code-mixed text. Always prefer the native script for the most accurate pronunciation. See Supported Languages.

Reference language doesn’t need to be English

Cross-lingual cloning works in any direction. A Tamil reference clip can drive Hindi, Bengali, or English generations equally well.

Longer references help cross-lingual quality

For cross-lingual generation, reference clips at the upper end of the recommended range (closer to 15 seconds than 10) give the model more speaker data to separate timbre from source-language phonetics.

Next steps