> This page is for Voice APIs.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://dev.hume.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://dev.hume.ai/_mcp/server.

# Voice Conversion

Voice conversion allows you to transform existing audio recordings by applying a different voice to them. Using [Octave](https://www.hume.ai/blog/octave-the-first-text-to-speech-model-that-understands-what-its-saying), Hume's speech-language model, you can convert any speech audio to sound like it was spoken by a voice from the [Voice Library](https://app.hume.ai/voices) or one of your custom voices, while preserving the original speech patterns, timing, and emotional expression.

Use the voice conversion playground to preview how your audio will sound with different voices:

#### [Voice Conversion Playground](https://app.hume.ai/voice-conversion)

Upload audio files and preview how they sound with different voices from the
Voice Library or your custom voices.

## Using the voice conversion API

The voice conversion API accepts an audio file and a target voice, then returns the converted audio with the specified voice applied. You can use any voice from the Voice Library or your custom voices.

### Audio file requirements

When uploading audio files for voice conversion, follow these guidelines:

* **Format**: Supported formats include `MP3`, `WAV`, `M4A`, and `OGG`
* **Duration**: Audio files should be at least 12 seconds long and less than 3 minutes in duration
* **Quality**: For best results, use clear audio with minimal background noise
* **Content**: Input audio should contain human speech
* **Sample rate**: 44.1kHz is recommended

> **Warning**
>
> **Upload only audio files for which you have the necessary rights or consent
> to convert.** Users must comply with Hume's [Terms of Use](https://www.hume.ai/terms-of-use), [Ethical Guidelines](https://thehumeinitiative.org/guidelines/), [Privacy Policy](https://www.hume.ai/privacy-policy), and applicable laws.

### Specifying a target voice

You can specify the target voice by `name` or `id`. When using `name`, include a `provider` to indicate whether you're using a voice from the Voice Library (`HUME_AI`) or a custom voice (`CUSTOM_VOICE`).

#### By ID

#### Specify either a custom voice or one from Hume's Voice Library by ID

```json
{
  "voice": {
    "id": "f898a92e-685f-43fa-985b-a46920f0650b",
    "provider": "HUME_AI"
  }
}
```

#### By Name

#### Specify a custom voice by name

```json
{
  "voice": {
    "name": "Your Custom Voice",
    "provider": "CUSTOM_VOICE"
  }
}
```

#### Specify a voice from Hume's Voice Library by name

```json
{
  "voice": {
    "name": "Male English Actor",
    "provider": "HUME_AI"
  }
}
```

> **Info**
>
> Get voice IDs and names from [/v0/tts/voices](/reference/voices/list) or from
> the Platform's [Voice Library page](https://app.hume.ai/voices).

## Converting audio

The following examples demonstrate how to convert an audio file using the voice conversion API. The endpoint accepts a multipart form request with the audio file and voice specification.

#### cURL

```cURL
curl --location 'https://api.hume.ai/v0/tts/voice_conversion/file' \
  -H "X-Hume-Api-Key: YOUR_HUME_API_KEY" \
  --output hume-voice-conversion-response.wav \
  -F 'audio=@path/to/your/audio.wav' \
  -F 'voice[name]=Inspiring Man' \
  -F 'voice[provider]=HUME_AI'
```

#### Python

```Python
import os
from hume import AsyncHumeClient

hume = AsyncHumeClient(api_key=os.getenv("HUME_API_KEY"))

with open("path/to/your/audio.mp3", "rb") as audio_file:
    response = await hume.tts.convert_voice_file(
        audio_file=audio_file,
        voice={
            "name": "Male English Actor",
            "provider": "HUME_AI"
        }
    )

# Save the converted audio
with open("converted_audio.mp3", "wb") as output_file:
    output_file.write(response.data)
```

#### TypeScript

```TypeScript
import { HumeClient } from "hume";
import * as fs from "fs";

const hume = new HumeClient({ apiKey: process.env.HUME_API_KEY });

const audioFile = fs.createReadStream("path/to/your/audio.mp3");
const voice = {
  name: "Male English Actor",
  provider: "HUME_AI"
} as const;

const response = await hume.tts.convertVoiceFile({
  audioFile,
  voice
});

// Save the converted audio
fs.writeFileSync("converted_audio.mp3", response.data);
```

### Response format

The voice conversion API returns the converted audio file in the same format as the input, or in a format you specify. The response includes the audio data that you can save to a file or stream directly to your application.

## Best practices

* **Use clear audio**: Voice conversion works best with high-quality audio recordings that have minimal background noise and clear speech
* **Test with short clips first**: Start with shorter audio files (12-30 seconds) to verify the conversion quality before processing longer files

## Use cases

Voice conversion is useful for a variety of applications:

* **Vocal instruction**: instead of giving the model written instruction, you can just pronounce the sentence exactly as it needs to be said
* **Voice consistency**: Standardize audio recordings to use a consistent voice across different speakers
* **Creative projects**: Experiment with different voices for audio content, podcasts, or narration

---