> This page is for Model APIs.

> Sarvam Voice Agents (Samvaad) is a voice AI agent platform for Indian languages: build, test and deploy AI calling agents on your own phone numbers, from ₹3 a minute. Start here: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# How to prepare reference audio

> Reference clip guidelines for the Sarvam AI Instant Voice Cloning API. What makes a good 10-15 second reference, technical specs, documented limits, and what to avoid.

The quality of your cloned voice is largely determined by the reference clip you provide. This page covers what makes a good reference, what to avoid, and how to handle common situations.

## What makes a good reference clip

#### 10-15 seconds

Long enough to capture the voice's character; short enough to keep latency low and avoid drift.

#### Clean, single speaker

Only one voice should be present. Background music, noise, and overlapping speech degrade the clone.

#### The performance you want copied

The clone speaks the way the reference speaks. Pace, energy, and emotion in the clip are what the model copies, so record in the style you want in the output and keep that delivery steady. See [The clone copies the performance](#the-clone-copies-the-performance).

#### Studio or quiet room

Low reverb, low background noise, and consistent microphone distance produce the most faithful clones.

## Recommended technical specs

| Property    | Recommended      | Notes                                                                                                                         |
| ----------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Format      | WAV              | Fastest to decode and avoids lossy compression artifacts. MP3, FLAC, OPUS, AAC, MULAW, ALAW, and LINEAR16 are also supported. |
| Sample rate | 16,000-24,000 Hz | The model resamples internally; higher rates do not improve cloning quality but increase upload size.                         |
| Channels    | Mono             | Stereo files are downmixed; sending mono saves bandwidth.                                                                     |
| Bit depth   | 16-bit PCM       | Sufficient for speech; higher bit depths offer no advantage.                                                                  |

## Documented limits

These limits are enforced by the API and a request that exceeds any of them is rejected with a `400`.

| Field                                                           | Limit                 |
| --------------------------------------------------------------- | --------------------- |
| `file` on `POST /voices/create`                                 | 50 MB                 |
| `ref_audio` on generate (`/voices/clone`, `/stream`, WebSocket) | 10 MB, max 15 seconds |
| Recommended duration                                            | 10-15 seconds         |

The model is tuned for short reference clips. Longer references rarely help and can introduce drift.

## The clone copies the performance

The model copies more than the speaker's voice. It also copies how they perform in the reference: pace, energy, and emotion.

A slow, flat read becomes a slow, flat clone. A quick, expressive read becomes a quick, expressive clone. Record the clip in the speaking style you want the generated speech to use. If you want calm narration, read it that way. If you want a conversational agent, speak the way that agent should sound.

Keep that performance consistent through the whole clip. A take that starts calm and ends rushed or shouted gives the model mixed signals, and later generations can swing between those styles. If you record more than one take, use the same pace and emotion in each one.

Whispering, shouting, and singing are copied the same way. A whispered reference produces a whispered clone.

## What to avoid

#### Background music or sound effects

Music behind speech is the single most common cause of poor clones. The model can't separate the voice from the music and may produce muffled or distorted output. Strip music before sending the reference.

#### Multiple speakers

If two people speak in the reference, the cloned voice will be a blend of both - usually neither sounds correct. Trim the clip down to a single speaker.

#### Heavy reverb or echo

Recordings made in large rooms, bathrooms, or via speakerphone carry room acoustics that get baked into the clone. The output will sound like it was recorded in the same room - even when you don't want that.

#### Heavily compressed or low-bitrate audio

Phone recordings (8 kHz) or low-bitrate MP3 (\< 64 kbps) lose the high-frequency detail needed for a faithful clone. Use the highest-quality source available.

#### A delivery you do not want copied

Whispering, shouting, singing, and a pace or emotion that changes mid-clip are all copied into the clone. Pick one performance and hold it for the whole reference.

## Create the voice or send the clip inline

**Saved voice (reuse):** upload the reference clip with `create_voice` / `POST /voices/create`. The API transcribes it automatically and returns a `voice_id`.

#### Python

```python
from sarvamai import SarvamAI

client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")

voice = client.voice_cloning.create_voice(
    name="my-voice",
    language="hi-IN",
    file=open("reference.wav", "rb"),
)
# voice.data.voice_id → pass to convert / convert_stream / voice_cloning_streaming
```

#### cURL

```bash
curl -s -X POST "https://api.sarvam.ai/voices/create" \
  -H "api-subscription-key: $SARVAM_API_KEY" \
  -F "name=my-voice" \
  -F "language=hi-IN" \
  -F "file=@reference.wav"
```

Use the returned `data.voice_id` with `convert` / `POST /voices/clone`, `convert_stream` / `/voices/clone/stream`, or WebSocket config.

**Inline generate:** send the same clip as `ref_audio` on each generate request (optional `ref_text`). Limits are stricter (10 MB, 15 seconds). Prefer a saved `voice_id` when you will call the API repeatedly.

## Cross-lingual references

The reference clip's language does not need to match `language_code`. You can clone an English voice and have it speak Hindi - the model preserves the speaker's timbre and identity while applying the phonetics and prosody of the target language. See [Clone Across Languages](/api/api-guides-tutorials/voice-cloning/how-to/clone-across-languages).

## Next steps

#### [Clone Across Languages](/api/api-guides-tutorials/voice-cloning/how-to/clone-across-languages)

Use a reference in one language to speak another.

#### [Choose Audio Formats](/api/api-guides-tutorials/voice-cloning/how-to/choose-audio-formats)

Input and output codecs and sample rates.