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.
def voices_clone(client: Cartesia) -> Any:
"""Clone a voice from an audio clip."""
with open("sample.wav", "rb") as clip:
voice = client.voices.clone(
clip=clip,
name="My Voice",
description="A custom voice",
language="en",
)
return voice
From cartesia-python/examples/examples.py:474async function voicesClone(client: Cartesia): Promise<void> {
/** Clone a voice from an audio clip. */
const clip = fs.createReadStream('sample.wav');
const voice = await client.voices.clone({
clip,
name: 'My Voice',
description: 'A custom voice',
language: 'en',
});
console.log('Cloned voice:', voice.id);
}
From cartesia-js/examples/node_examples.ts:348
Run this example
cd cartesia-python
CARTESIA_API_KEY=YOUR_KEY python3 examples/examples.py voices_clone
cd cartesia-js
CARTESIA_API_KEY=YOUR_KEY npx ts-node examples/node_examples.ts voicesClone