Voice cloning requires only a 10–20 second audio sample to generate a highly similar custom voice without model training.
Overview
Voice cloning is designed for scenarios such as personalized voice assistants, brand-exclusive broadcasts, and customized audio content.
Alibaba Cloud Model Studio provides voice cloning capabilities through the following model series:
- Qwen-Audio-TTS / CosyVoice: Create voices through the DashScope SDK or HTTP API. Supports real-time and non-real-time speech synthesis. Available in the Beijing and Singapore regions.
- MiniMax: Create voices through the HTTP API. Supports non-real-time speech synthesis only. Available in the Beijing region only.
- Qwen-Audio-Realtime: Qwen-Audio-Realtime is a real-time voice dialogue model (not a speech synthesis model). Voice cloning is used to customize the TTS voice of the dialogue model's responses. Create voices through the DashScope SDK or HTTP API. Available in the China (Beijing) region only.
Prerequisites
- Configure an API key and set it as an environment variable.
- If you call the API through the DashScope SDK, install the latest SDK.
- Prepare an audio file: The audio must meet the Audio requirements.
Quick start
Voice cloning involves three steps:
- Prepare audio: Prepare an audio file that meets the Audio requirements.
- Create a voice: Call the voice cloning API to upload audio and create a voice. Use the
target_modelparameter to specify the speech synthesis model to bind. - Synthesize speech with the cloned voice: Call the speech synthesis API with the voice ID returned in the previous step.
Qwen-Audio-TTS voice cloning
Step 1: Create a voice
Call the voice cloning API to upload audio and create a voice. The url parameter specifies the accessible URL of the audio file, and the prefix parameter serves as the voice name prefix.
The following configuration is for the China (Beijing) region. To use a model in the Singapore region, replace the domain with https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customization. Replace {WorkspaceId} with your actual Workspace ID.
voice_id value returned in the previous step in the following request.
Qwen-Audio-Realtime voice cloning
Step 1: Create a voice
Use the DashScope SDK or HTTP API to call the voice cloning API, upload audio, and create a voice. The target_model parameter specifies the real-time dialogue model name, and the prefix parameter serves as the voice name prefix.
- Python
- cURL
voice_id returned in the previous step to the voice parameter in the session.update event. For details, see Voice configuration.
CosyVoice voice cloning
Step 1: Create a voice
Call the voice cloning API to upload audio and create a voice. The url parameter specifies the accessible URL of the audio file, and the prefix parameter serves as the voice name prefix.
The following configuration is for the China (Beijing) region. To use a model in the Singapore region, replace the domain with https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/audio/tts/customization. Replace {WorkspaceId} with your actual Workspace ID.
voice_id value returned in the previous step in the following request.
MiniMax voice cloning
MiniMax voice cloning is available in the Beijing region only. After you submit a cloning request, the system generates an audition audio clip (billed at the synchronous speech synthesis rate). The first time you use a cloned voice for speech synthesis, a voice unlock fee of CNY 9.9 is charged.
Step 1: Create a voice
Call the voice cloning API to upload audio and create a voice. The voice_id parameter specifies the ID for the new voice, and the audio_url parameter specifies the accessible URL of the audio file.
voice_id value specified in the previous step in the following request.
Audio requirements
The quality of the input audio directly determines the cloning result. Different model series have different audio requirements. Prepare your audio sample according to the requirements of your target model.
- Qwen-Audio-TTS / Qwen-Audio-Realtime
- CosyVoice
- MiniMax
Item | Requirement |
|---|---|
Supported formats | WAV (16-bit), MP3, M4A |
Audio duration | 10–20 seconds recommended, 60 seconds maximum |
File size | ≤ 10 MB |
Sample rate | ≥ 16 kHz |
Channels | Mono or stereo. For stereo audio, only the first channel is processed. Ensure the first channel contains valid speech. |
Content | The audio must contain at least 5 seconds of continuous, clear speech (no background sound). The remaining portion may only contain brief pauses (≤ 2 seconds). Avoid background music, ambient noise, or other voices throughout. Use audio recorded at normal speaking speed — do not upload songs or singing recordings. |
Supported languages | Chinese (Mandarin, Cantonese, Chongqing, Northeastern, Gansu, Guizhou, Zhejiang, Hebei, Henan, Hubei, Hunan, Jiangxi, Ningbo, Ningxia, Qingdao, Shaanxi, Shanxi, Shandong, Shanghai, Sichuan, and Yunnan dialects), English, Japanese, Korean, Russian, French, German, Portuguese, Thai, Indonesian, Vietnamese, Spanish, Italian, Malaysian, Filipino, and Arabic |
Recording tips
High-quality input audio is the foundation for achieving optimal cloning results.
Recording equipment
You can use a smartphone, digital voice recorder, or professional recording device. We recommend a device that supports high sample rate recording (≥ 24 kHz) to meet the audio requirements.
Recording environment
Location
- Record in a small, enclosed space of 10 square meters or less.
- Prioritize rooms with sound-absorbing materials such as acoustic foam, carpets, or curtains.
- Avoid open halls, conference rooms, classrooms, and other high-reverberation spaces.
- External noise: Close doors and windows to avoid traffic, construction, and other disturbances.
- Internal noise: Turn off air conditioners, fans, fluorescent lamp ballasts, and other equipment. You can record the ambient sound on your phone and play it back at high volume to identify potential noise sources.
- Reverberation causes sound to become blurry and reduces clarity.
- Reduce reflections from smooth surfaces: close curtains, open wardrobe doors, and drape clothing or blankets over tables and cabinets.
- Use irregular objects (such as bookshelves and upholstered furniture) to create diffuse reflections.
Recording script
- There are no specific content restrictions. We recommend matching the content to your target use case.
- Avoid short phrases (such as "hello" or "yes"). Use complete sentences.
- Maintain semantic coherence and avoid frequent pauses while reading (at least 3 continuous seconds without interruption is recommended).
- Maintain a consistent speaking speed throughout. Avoid speaking too fast at the beginning or end, which can cause stuttering during synthesis.
- Include appropriate emotional expression (such as warmth, friendliness, or seriousness). Avoid mechanical reading.
- Do not include sensitive content (such as political, pornographic, or violent material). This will cause cloning to fail.
Best practices
Using a typical bedroom as an example, after completing noise and reverberation control:
- Familiarize yourself with the script beforehand, set a character tone, and deliver naturally.
- Maintain approximately 10 cm distance from the recording device to avoid plosive distortion or weak signal.
Manage custom voices
After creating a voice, you can query and manage existing voices through the API (supported by Qwen-Audio-TTS, Qwen-Audio-Realtime, and CosyVoice).
- List voices: Retrieve a list of all custom voices under the current account.
- Get voice details (Qwen-Audio-TTS / Qwen-Audio-Realtime / CosyVoice only): View detailed information about a specific voice, such as creation time and bound speech synthesis model.
- Delete a voice: Delete custom voices that are no longer needed to free up quota.
Quota and billing
Voice quota and automatic cleanup
- Voice limit: Each Alibaba Cloud Model Studio account can create up to 1,000 custom voices for Qwen-Audio-TTS / Qwen-Audio-Realtime / CosyVoice. After reaching the limit, new creation requests will fail and return an error. The system does not automatically delete the earliest created voices. To create new voices, delete unneeded voices to free up quota, or wait for unused voices to be automatically cleaned up (see the automatic cleanup rules below).
- Behavior after reaching the limit: After reaching the 1,000-voice limit, subsequent calls to the voice creation API will return a failure error. The system does not automatically evict the earliest created voices to make room. You must manually delete unneeded voices to free up quota before you can continue creating voices.
- Automatic cleanup rule: If a voice has not been used for any speech synthesis request in the past year, the system automatically deletes it.
Billing rules
- Qwen-Audio-TTS / Qwen-Audio-Realtime / CosyVoice: Voice creation is free.
- MiniMax: Voice cloning itself is free. The first time you use a cloned voice for speech synthesis, a voice unlock fee of CNY 9.9 is charged. No free quota is provided.
Supported models and regions
- China (Beijing)
- Singapore
- Qwen-Audio-TTS: qwen-audio-3.0-tts-plus, qwen-audio-3.1-tts-flash, qwen-audio-3.0-tts-flash
- Qwen-Audio-Realtime: qwen-audio-3.1-realtime-plus, qwen-audio-3.0-realtime-plus, qwen-audio-3.0-realtime-flash
- CosyVoice: cosyvoice-v3.5-plus, cosyvoice-v3.5-flash, cosyvoice-v3-plus, cosyvoice-v3-flash, cosyvoice-v2
- MiniMax: MiniMax/speech-2.8-hd, MiniMax/speech-02-hd, MiniMax/speech-2.8-turbo, MiniMax/speech-02-turbo
API reference
Voice cloning API reference
FAQ
Q: Can I use a created voice with different speech synthesis models?
No. A voice is bound to a specific speech synthesis model through the target_model parameter at creation time and cannot be used across models. If you need to use the same audio's voice with multiple models, create a separate voice for each model.