CosyVoice
Copy success!
Overview
Synthesis Capabilities: CosyVoice-v3-Flash is the latest high-performance speech synthesis model in the CosyVoice series from Tongyi Labs, offering improved naturalness, timbre, prosody, and emotional expressiveness compared to previous versions. This model supports real-time streaming text-to-speech synthesis. Cloning Capabilities: CosyVoice-v3-Flash is also the latest speech cloning model in the CosyVoice series from Tongyi Labs. Compared to previous versions, it improves pronunciation accuracy and timbre similarity, and adds support for more less commonly spoken languages (German, Spanish, French, Italian, Russian). It can quickly generate highly similar and naturally sounding custom voices from just 5-20 seconds of reference audio.
Input
Text
Output
Audio
Features
Prefix Completion
Enable Partial Mode when calling the Qwen API to make the model continue strictly from your provided prefix text.View docsFunction Calling
Use function calling to connect large language models with external tools and systems.View docsCache
Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docsStructured Outputs
Structured Outputs help ensure the model returns a JSON string in the expected format.View docsPricing
- TTS$0.13Per 10,000 characters
Rate Limits
- RPMRequests Per Minute180
API Reference
Call APICopy success!
12345678910111213141516
# coding=utf-8
import dashscope
from dashscope.audio.tts_v2 import *
# If the API Key is not configured in the environment variable, your-api-key needs to be replaced with your own API Key
# dashscope.api_key = "your-api-key"
model = "cosyvoice-v3-flash"
voice = "longanyang"
synthesizer = SpeechSynthesizer(model=model, voice=voice)
audio = synthesizer.call("今天天气怎么样?")
with open('output.mp3', 'wb') as f:
f.write(audio)