$npx -y skills add cinience/alicloud-skills --skill aliyun-qwen-tts-realtimeUse when real-time speech synthesis is needed with Alibaba Cloud Model Studio Qwen TTS Realtime models. Use when low-latency interactive speech is required, including instruction-controlled realtime synthesis.
| 1 | Category: provider |
| 2 | |
| 3 | # Model Studio Qwen TTS Realtime |
| 4 | |
| 5 | Use realtime TTS models for low-latency streaming speech output. |
| 6 | |
| 7 | ## Critical model names |
| 8 | |
| 9 | Use one of these exact model strings: |
| 10 | - `qwen3-tts-flash-realtime` |
| 11 | - `qwen3-tts-instruct-flash-realtime` |
| 12 | - `qwen3-tts-instruct-flash-realtime-2026-01-22` |
| 13 | - `qwen3-tts-vd-realtime-2026-01-15` |
| 14 | - `qwen3-tts-vc-realtime-2026-01-15` |
| 15 | |
| 16 | ## Prerequisites |
| 17 | |
| 18 | - Install SDK in a virtual environment: |
| 19 | |
| 20 | ```bash |
| 21 | python3 -m venv .venv |
| 22 | . .venv/bin/activate |
| 23 | python -m pip install dashscope |
| 24 | ``` |
| 25 | - Set `DASHSCOPE_API_KEY` in your environment, or add `dashscope_api_key` to `~/.alibabacloud/credentials`. |
| 26 | |
| 27 | ## Normalized interface (tts.realtime) |
| 28 | |
| 29 | ### Request |
| 30 | - `text` (string, required) |
| 31 | - `voice` (string, required) |
| 32 | - `instruction` (string, optional) |
| 33 | - `sample_rate` (int, optional) |
| 34 | |
| 35 | ### Response |
| 36 | - `audio_base64_pcm_chunks` (array<string>) |
| 37 | - `sample_rate` (int) |
| 38 | - `finish_reason` (string) |
| 39 | |
| 40 | ## Operational guidance |
| 41 | |
| 42 | - Use websocket or streaming endpoint for realtime mode. |
| 43 | - Keep each utterance short for lower latency. |
| 44 | - For instruction models, keep instruction explicit and concise. |
| 45 | - Some SDK/runtime combinations may reject realtime model calls over `MultiModalConversation`; use the probe script below to verify compatibility. |
| 46 | |
| 47 | ## Local demo script |
| 48 | |
| 49 | Use the probe script to verify realtime compatibility in your current SDK/runtime, and optionally fallback to a non-realtime model for immediate output: |
| 50 | |
| 51 | ```bash |
| 52 | .venv/bin/python skills/ai/audio/aliyun-qwen-tts-realtime/scripts/realtime_tts_demo.py \ |
| 53 | --text "This is a realtime speech demo." \ |
| 54 | --fallback \ |
| 55 | --output output/ai-audio-tts-realtime/audio/fallback-demo.wav |
| 56 | ``` |
| 57 | |
| 58 | Strict mode (for CI / gating): |
| 59 | |
| 60 | ```bash |
| 61 | .venv/bin/python skills/ai/audio/aliyun-qwen-tts-realtime/scripts/realtime_tts_demo.py \ |
| 62 | --text "realtime health check" \ |
| 63 | --strict |
| 64 | ``` |
| 65 | |
| 66 | ## Output location |
| 67 | |
| 68 | - Default output: `output/ai-audio-tts-realtime/audio/` |
| 69 | - Override base dir with `OUTPUT_DIR`. |
| 70 | |
| 71 | ## Validation |
| 72 | |
| 73 | ```bash |
| 74 | mkdir -p output/aliyun-qwen-tts-realtime |
| 75 | for f in skills/ai/audio/aliyun-qwen-tts-realtime/scripts/*.py; do |
| 76 | python3 -m py_compile "$f" |
| 77 | done |
| 78 | echo "py_compile_ok" > output/aliyun-qwen-tts-realtime/validate.txt |
| 79 | ``` |
| 80 | |
| 81 | Pass criteria: command exits 0 and `output/aliyun-qwen-tts-realtime/validate.txt` is generated. |
| 82 | |
| 83 | ## Output And Evidence |
| 84 | |
| 85 | - Save artifacts, command outputs, and API response summaries under `output/aliyun-qwen-tts-realtime/`. |
| 86 | - Include key parameters (region/resource id/time range) in evidence files for reproducibility. |
| 87 | |
| 88 | ## Workflow |
| 89 | |
| 90 | 1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating. |
| 91 | 2) Run one minimal read-only query first to verify connectivity and permissions. |
| 92 | 3) Execute the target operation with explicit parameters and bounded scope. |
| 93 | 4) Verify results and save output/evidence files. |
| 94 | |
| 95 | ## References |
| 96 | |
| 97 | - `references/sources.md` |