Voice Conversion
Convert the voice in an audio file to a different target voice while preserving the original speech content. This endpoint accepts an audio file and a target voice ID, and returns a WAV audio file with the converted voice.
Request Parameters
This endpoint requires multipart/form-data for file uploads.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your API key for authentication |
| data | file | Yes | Source audio file to convert. Supported formats: wav, mp3, m4a, flac, ogg. |
| voice_id | string | Yes | The unique identifier of the target voice to convert to. Browse available voices in the voice library. |
Example Request
Here are examples of how to convert voice in audio files using different programming languages.
to auto-fill your API key in the code examples below.
curl -X POST "https://cantonese.ai/api/voice-conversion" \
-F "api_key=YOUR_API_KEY" \
-F "voice_id=YOUR_VOICE_ID" \
-F "[email protected];type=audio/wav" \
--output output.wavResponse
On success, the API returns a direct audio/wav file containing the voice-converted audio.
Direct Audio File
The API returns a WAV audio file directly. Save the response body to a file to use the converted audio.
Status Codes
The API returns standard HTTP status codes to indicate the success or failure of requests.
| Status Code | Description |
|---|---|
| 200 | Success - Voice converted successfully, returns WAV audio file |
| 400 | Bad Request - Invalid voice_id or missing required parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Internal Server Error - Server encountered an unexpected condition |