Loading...
Loading...
Generate human-like speech audio with Model Studio DashScope Qwen TTS (qwen3-tts-flash). Use when converting text to speech, producing voice lines for short drama/news videos, or documenting TTS request/response fields for DashScope.
npx skill4agent add cinience/alicloud-skills alicloud-ai-audio-ttsqwen3-tts-flashpython3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscopeDASHSCOPE_API_KEYdashscope_api_key~/.alibabacloud/credentialstextvoicelanguage_typeAutostreamaudio_urlaudio_base64_pcmsample_rateformatimport os
import dashscope
# Prefer env var for auth: export DASHSCOPE_API_KEY=...
# Or use ~/.alibabacloud/credentials with dashscope_api_key under [default].
# Beijing region; for Singapore use: https://dashscope-intl.aliyuncs.com/api/v1
dashscope.base_http_api_url = "https://dashscope.aliyuncs.com/api/v1"
text = "Hello, this is a short voice line."
response = dashscope.MultiModalConversation.call(
model="qwen3-tts-flash",
api_key=os.getenv("DASHSCOPE_API_KEY"),
text=text,
voice="Cherry",
language_type="English",
stream=False,
)
audio_url = response.output.audio.url
print(audio_url)stream=Truefinish_reason == "stop"language_type(text, voice, language_type)output/ai-audio-tts/audio/OUTPUT_DIRreferences/api_reference.mdreferences/sources.md