> ## 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.

# Clone a Voice

> Clone a voice from an audio clip.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    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:474](https://github.com/cartesia-ai/cartesia-python/blob/main/examples/examples.py#L474)
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    async 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](https://github.com/cartesia-ai/cartesia-js/blob/main/examples/node_examples.ts#L348)
  </Tab>
</Tabs>

## Run this example

<Tabs>
  <Tab title="Python">
    ```sh theme={null}
    cd cartesia-python
    CARTESIA_API_KEY=YOUR_KEY python3 examples/examples.py voices_clone
    ```
  </Tab>

  <Tab title="TypeScript">
    ```sh theme={null}
    cd cartesia-js
    CARTESIA_API_KEY=YOUR_KEY npx ts-node examples/node_examples.ts voicesClone
    ```
  </Tab>
</Tabs>
