Alibaba Cloud Bailian - Tongyi Speech Large Models - Development Examples
English | 简体中文
This repository demonstrates how to call Speech Large Models (including Qwen-Audio-3.1-TTS, Qwen-Audio-3.1-ASR, CosyVoice, Fun-ASR, etc.) via Alibaba Cloud Bailian, enabling functions like speech recognition (speech-to-text), speech synthesis (text-to-speech), and advanced AI capabilities such as voice chat, audio analysis, and real-time translation when integrated with large language models (e.g., Qwen-OMNI, Qwen, Baichuan, Moonshot, 01.AI, MiniMax). Developers can test examples using Bailian's free quota and integrate these samples into their projects for further development. For technical support, join our DingTalk group.

⭐ Latest Updates ⭐
2026-11-03
- Added the Node.js SDK based Qwen Audio Experience app to the Gallery, covering real-time dictation, speech synthesis and real-time conversation.
2026/11/02
- Upgraded the ASR, TTS, Omni, and Realtime Python examples to the DashScope SDK 2.0.2
Client/v2 APIs;
- Upgraded Qwen-Audio ASR, streaming ASR, recorded-file transcription, TTS, and Realtime examples to verified 3.1 models and voices.
2026/08/14
- Added Qwen-Audio-3.0-TTS speech synthesis and voice cloning examples, with voice style, dialect and emotion controllable by instruction.
- Added the Qwen-Audio-3.0-ASR speech recognition examples, covering non-streaming recognition, streaming recognition (with hotwords and dialog context) and recorded-file transcription.
2026/07/14
- Added Qwen-Audio-3.0-Realtime end-to-end real-time voice conversation example (companion chat, tool calling, and reasoning routing scenarios).
:point_right: Getting Started
- Clone the repository via
git clone or download the ZIP file.
- Prerequisites: Create an Alibaba Cloud account, activate Bailian Model Service, generate an API_KEY, configure the environment, and install the DashScope SDK. Detailed steps are in PREREQUISITES.md. Check individual
README.md files in example directories for specific dependencies.
:point_right: Use Cases & Examples
:rocket: Recommended Scenarios
| Use Case |
Description |
Example |
| Qwen-Audio-3.1-ASR Streaming Recognition |
Unlimited-duration real-time streaming recognition with hotwords and dialog context |
Streaming Recognition |
| Qwen-Audio-3.1-ASR Non-Streaming Recognition |
One-shot recognition of an audio URL, with dialog context, up to 5 min / 2 GB |
Non-Streaming Recognition |
| Qwen-Audio-3.1-ASR File Transcription |
Asynchronous transcription of recordings up to 12 hours, with speaker diarization |
File Transcription |
| Qwen-Audio-3.1-TTS Synthesis |
Control style, dialect and emotion by instruction, with real-time streaming playback |
Instruction-Controlled Synthesis |
| Qwen-Audio-3.1-TTS Voice Cloning |
Clone a voice from one audio sample and synthesize any text with it |
Voice Cloning Synthesis |
| Qwen-Audio-3.1-Realtime Voice Chat |
End-to-end real-time voice conversation over WebSocket (companion chat, tool calling, reasoning routing) |
qwen-audio-3.1-realtime |
More Agent scenarios: qwen-audio-agent provides production-grade Agent examples built on Qwen-Audio-Realtime, including multi-turn memory, tool orchestration, and multimodal input.
:sparkles: Advanced Usage
| Use Case |
Description |
Example |
| Streaming + Dialog Context |
Pass dialog history or domain terms to improve accuracy, with limit-aware trimming |
Dialog Context |
| Streaming + Precompiled Vocabulary |
Create a vocabulary once and reuse by ID; covers the full create/query/recognize/delete lifecycle |
Precompiled Vocabulary |
| TTS Instruction Guide |
Style, dialect, emotion tags and combined usage with a full tag reference table |
Instruction Guide |
| TTS Text Normalization (TN) |
Synthesis of hard-to-read text: quantities, units, percent signs, ranges, hotline numbers and polyphones |
Text Normalization Showcase |
| TTS All-in-One Multilingual |
One single voice longanhuan_v3.1 speaks 16 languages while keeping the same timbre |
Multilingual Synthesis |
:musical_note: Music Generation
| Use Case |
Description |
Example |
| Generate Music from Prompt |
Input music style description, auto-generate lyrics and sing |
Generate from Prompt |
| Generate Music from Lyrics |
Provide custom lyrics, AI composes and sings |
Generate from Lyrics |
:telephone: Call Center & Dialogue Analysis
:loudspeaker: Voice Broadcasting & Dubbing
| Use Case |
Description |
Example |
| Information Broadcasting |
Convert text to speech for announcements |
Streaming Synthesis |
| Real-Time LLM Output Broadcasting |
Stream LLM outputs as speech |
LLM Streaming Synthesis |
| Dialect & Emotional Dubbing |
Set dialect and speaking style by instruction, or control emotion with inline tags |
Instruction-Controlled Synthesis |
| Signature Voice Broadcasting |
Clone a host or brand voice for consistent content broadcasting |
Voice Cloning Synthesis |
| Multilingual Broadcasting |
Switch among 16 languages with one All-in-One voice for internationalized content |
Multilingual Synthesis |
| Numeric & Professional Text |
Text Normalization auto-handles quantities, units and symbols for natural reading |
Text Normalization Showcase |
:raising_hand: Meeting Analysis
:film_strip: Audio/Video Analysis
:speech_balloon: Voice Chat
| Use Case |
Description |
Example |
| Sentence-Level Recognition & Translation |
Real-time sentence recognition and translation |
Sentence-Level Example |
| Voice Chat with LLM |
Voice interaction with large language models |
Alibaba Cloud Documentation |
| Video Chat with LLM |
Video chat via multimodal large models |
Omni Example |
| End-to-End Real-Time Voice Chat |
WebSocket-based real-time voice conversation SDK and examples (companion chat, tool calling, reasoning routing) |
qwen-audio-3.1-realtime |
:point_right: High-Concurrency Usage
For Java-based services, refer to the high-concurrency guides:
:star: Featured Apps
| Project |
Description |
Platform |
| Qwen Audio Experience |
A complete voice web app built on the Node.js SDK. Run ./start.sh (start.bat on Windows) to try Qwen Audio 3.1 real-time dictation, speech synthesis and real-time conversation in the browser, with a developer console that shows the SDK protocol frames. |
Node.js 18+ (downloaded by the launcher if missing), macOS / Linux / Windows |

:sparkles: Community Projects
| Project |
Description |
Platform |
| Cosight |
Contributed by community developer @MrGood4U. A realtime multimodal AI assistant desktop client: talk to it while it watches your screen, and let it draw annotations on the desktop to help explain |
Windows 10 or later |
The Gallery showcases creative applications built with Bailian AI capabilities. Contribute your projects to inspire others!
:point_right: FAQ
:point_right: License
This project is licensed under the MIT License.
:point_right: Changelog
2026-11-03
- Added the Node.js SDK based Qwen Audio Experience app to the Gallery, covering real-time dictation, speech synthesis and real-time conversation.
2026/11/02
- Upgraded the ASR, TTS, Omni, and Realtime Python examples to the DashScope SDK 2.0.2
Client/v2 APIs;
- Upgraded Qwen-Audio ASR, streaming ASR, recorded-file transcription, TTS, and Realtime examples to verified 3.1 models and voices.
2026/08/14
- Added Qwen-Audio-3.0-TTS speech synthesis and voice cloning examples, with voice style, dialect and emotion controllable by instruction.
- Added the Qwen-Audio-3.0-ASR speech recognition examples, covering non-streaming recognition, streaming recognition (with hotwords and dialog context) and recorded-file transcription.
2026/07/14
- Added Qwen-Audio-3.0-Realtime end-to-end real-time voice conversation example (companion chat, tool calling, and reasoning routing scenarios).
2026/06/16
- Added Fun-Music (Bailing Music Generation) examples, supporting music generation from prompts and lyrics.
- Improved graceful session finish in the Omni demo.
- Added Omni function calling example.
2025/12/19
- update default asr model to fun-asr
- update default tts model to cosyvoice-v3-flash
2025/07/21
- Added qwen-omni demo.
- Added qwen-tts-realtime demo.
2025/06/17
- Added English readme docs
- TTS model update to cosyvoice-v2
2025/02/14
- Added JavaScript examples for CosyVoice and Paraformer.
2025/01/24
- Added local file recognition example with Opus format conversion.
- Updated HTML streaming audio player for mobile/Safari compatibility.
2025/01/17
- Unified Java examples as Maven projects.
- Added voice cloning and Gummy translation examples.
- Introduced Gallery section.
2024/08/14
2024/07/24
- Added parallel speech recognition/synthesis examples.
- Added story narration with real-time subtitles (Python/Java).
- Added web-based AI Assistant example.
2024/07/19
- Updated documentation structure with speech quality inspection examples.
2024/07/05
2024/06/25
- Initial release with Python/Java examples for microphone/file input and speech synthesis.