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 speech synthesis. Available in the Beijing and Singapore regions.
- 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.
- Qwen-TTS: Create voices through the HTTP API. Supports real-time and non-real-time speech synthesis. Available in the Beijing and Singapore regions.
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 Singapore region. To use a model in the China (Beijing) region, replace the domain with https://{WorkspaceId}.cn-beijing.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 Singapore region. To use a model in the China (Beijing) region, replace the domain with https://{WorkspaceId}.cn-beijing.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-TTS voice cloning
The following examples use a local audio file voice.mp3. Replace it with your actual file path when running the code.
- Python
- cURL
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
- Qwen-TTS
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, Qwen-TTS, 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 and up to 1,000 for Qwen-TTS (the two quotas are calculated independently). 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.
-
Qwen-TTS: Billed at $0.01/voice. Failed creations are not billed.
Free quota (available in the Singapore region only):
- Within 90 days of activating Alibaba Cloud Model Studio, you can create up to 1,000 voices for free.
- Failed creations do not count against the free quota.
- Deleting a voice does not restore the free quota.
- After the free quota is used up or the 90-day period expires, voice creation is billed at $0.01/voice.
Supported models and regions
- Singapore
- China (Beijing)
- Qwen-Audio-TTS: qwen-audio-3.0-tts-plus, qwen-audio-3.0-tts-flash
-
CosyVoice: cosyvoice-v3-plus (
cosyvoice-v3-flashdoes not currently support speech synthesis with cloned voices in the Singapore region. Useqwen-audio-3.0-tts-flashinstead.) -
Qwen-TTS:
- Qwen3-TTS-VC-Realtime: qwen3-tts-vc-realtime-2026-01-15 (latest snapshot), qwen3-tts-vc-realtime-2025-11-27 (snapshot)
- Qwen3-TTS-VC: qwen3-tts-vc-2026-01-22 (latest snapshot)
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.