cantonese.aiAPI Reference

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.

ParameterTypeRequiredDescription
api_keystringYesYour API key for authentication
datafileYesSource audio file to convert. Supported formats: wav, mp3, m4a, flac, ogg.
voice_idstringYesThe 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.wav

Response

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 CodeDescription
200Success - Voice converted successfully, returns WAV audio file
400Bad Request - Invalid voice_id or missing required parameters
401Unauthorized - Invalid or missing API key
500Internal Server Error - Server encountered an unexpected condition