Skip to main content

Voice design

Create custom voices through natural language descriptions, preview them, and use them for speech synthesis.

Voice design is suitable for scenarios such as rapid prototyping, creative content production, and game character voiceover.
Creating a voice does not require an audio sample. If you need to reproduce a voice from an existing audio sample, use voice cloning.

Preparations

Obtain an API Key in the console, and configure the DASHSCOPE_API_KEY environment variable. Install the DashScope SDK and requests:
pip install -U dashscope requests

Get Started

Qwen-Audio-TTS and CosyVoice use the same workflow for voice creation, preview, and basic synthesis. The following example uses qwen-audio-3.1-tts-flash.
  1. Create a voice: Set the voice description voice_prompt, preview text preview_text, and target model target_model to obtain the voice ID.
  2. Save the preview audio: Decode the returned preview_audio.data and save it as a WAV file for audition.
  3. Synthesize speech: Use the voice_id returned during voice creation as the voice, and synthesize speech with the bound model.
import base64
import os

import dashscope

# The following is the configuration for the China (Beijing) region. Replace "{WorkspaceId}" with your actual workspace ID. The configuration differs by region.
client = dashscope.Client(
    # If you have not configured an environment variable, replace the following line with your Model Studio API key: api_key="sk-xxx"
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    workspace="{WorkspaceId}",
    region="cn-beijing",
)

target_model = "qwen-audio-3.1-tts-flash"

# Create a voice and save the returned preview audio locally.
designed = client.audio.voice_design.create(
    target_model=target_model,
    voice_prompt="A calm middle-aged male announcer with a deep, resonant voice, steady speaking pace, and clear articulation, suited for news broadcasts or documentaries.",
    preview_text="Good evening, everyone. Welcome to the evening news.",
    prefix="announcer",
    language_hints=["en"],
    parameters={"sample_rate": 24000, "response_format": "wav"},
)
# The voice ID has the form {target_model}-vd-{prefix}-{unique_id}.
voice_id = designed.voice_id
print(f"voice_id: {voice_id}")
with open("preview.wav", "wb") as f:
    f.write(base64.b64decode(designed.preview_audio["data"]))

# Synthesize speech with the model specified at voice creation and the returned voice ID.
audio = client.audio.tts.synthesize(
    "The weather is clear today, perfect for a walk outside. Have a wonderful day.",
    model=target_model,
    voice=voice_id,
    format="wav",
    sample_rate=24000,
)
with open("output.wav", "wb") as f:
    f.write(audio)
After you run the sample, preview.wav is the preview audio, and output.wav is the synthesized audio. Save the printed voice ID, which you can later use to call speech synthesis. For HTTP request samples, optional parameters, and response fields, see the voice design API reference; for synthesis parameters, see Qwen-Audio-TTS Python SDK.

Voice Description Guidelines

A voice description (voice_prompt) specifies the desired voice characteristics. Clear, specific descriptions help generate a voice that meets your requirements.

Description Tips

  • Specific: Use voice characteristics such as "deep", "crisp", or "relatively fast speech rate", and avoid vague evaluations such as "pleasant" or "general".
  • Multidimensional: Combine dimensions such as gender, age, pitch, speech rate, and emotion. Writing only "female voice" is not enough to describe a distinctive voice.
  • Objective: Describe perceivable voice characteristics, such as "high-pitched and energetic", and avoid subjective expressions such as "my favorite voice".
  • Original: Describe voice characteristics without imitating specific people such as celebrities or actors. The model does not support specified imitation, and related requests may also involve copyright risks.
  • Concise: Reduce redundant synonyms and meaningless modifiers.
You can combine the following dimensions to write a voice description:
DimensionExample description
GenderMale, female, neutral
AgeChildren (5-12 years old), teenagers (13-18 years old), youth (19-35 years old), middle-aged (36-55 years old), elderly (over 55 years old)
PitchHigh, mid, low, relatively high, relatively low
Speech rateFast, medium, slow, slightly fast, slightly slow
EmotionCheerful, calm, gentle, serious, lively, composed, soothing
BenefitMagnetic, crisp, raspy, mellow, sweet, deep, powerful
Use casesNews broadcasts, advertising voiceovers, audio books, animation characters, voice assistants, documentary narration

Description examples

  • Standard broadcasting style: clear and precise articulation with standard pronunciation
  • A young, lively female voice with a fast speech rate and a distinctly rising intonation, suitable for introducing fashion products
  • A composed middle-aged male with a slow speech rate and a deep, magnetic voice, suitable for reading news or documentary narration
  • A gentle and intellectual female around 30 years old with a mild tone, suitable for audio book narration
  • A cute child voice, approximately an 8-year-old girl, speaking with a touch of childishness, suitable for animation character voiceovers
The same description may generate different voices. After creation, listen to the preview audio first; when you need to compare results, generate multiple times and pick the best one.

Voice management

  • Query voice list: View existing custom voices.
  • Query voice details: View information such as the model bound to a voice and its status.
  • Delete voice: Delete voices that are no longer used to release quota.
For API and parameter details, see Voice Design API references.

Supported models

  • China (Beijing)
  • Qwen-Audio-TTS:qwen-audio-3.1-tts-plus、qwen-audio-3.1-tts-flash、qwen-audio-3.0-tts-plus、qwen-audio-3.0-tts-flash
  • CosyVoice:cosyvoice-v3.5-plus、cosyvoice-v3.5-flash、cosyvoice-v3-plus、cosyvoice-v3-flash
CosyVoice voice design is based on the FunAudioGen-VD model capabilities.

Quotas and limits

  • Voice quantity: Each Alibaba Cloud Bailian account can have up to 1000 custom voices in total. Voice cloning and voice design share this quota, which is not counted separately per model.
    After the limit is reached, new voice cloning or voice design creation requests will fail. Delete voices that are no longer used to release quota before creating new ones.
  • Voice description: voice_prompt supports Chinese and English only, with a maximum length of 500 characters.
  • Preview text: preview_text supports Chinese and English only, with a length of 15 to 200 characters.
  • Model binding: A voice is bound to a speech synthesis model via target_model at creation, and subsequent synthesis must use the same model.
Generated voices can be used to synthesize speech in multiple languages. For the specific supported scope, refer to the target speech synthesis model.

Billing details

Creating a voice is free of charge. When using a designed voice to synthesize speech, billing is based on the target speech synthesis model. For specific fees, see Model pricing.