Qwen3-TTS Voice Cloning (0.6B)
Zero-shot offline voice cloning powered by Alibaba's
Qwen3-TTS 0.6B model.
When to Use
- User provides a reference voice sample (
.wav, .mp3, .flac) + target text
- User asks to "clone my voice", "模仿这个声音说话", "声音克隆", "make X say Y"
- Offline / local-only operation is required — no cloud API calls
- Target languages: Chinese, English, Japanese, Korean, German, French,
Russian, Portuguese, Spanish, Italian (+
Auto detection)
Boundaries
- Does not handle video input — user must extract audio first
- Does not require the reference audio transcript (x_vector_only_mode)
- Reference audio: ideally ~10 seconds, clean, single speaker
- Quality is lower than the 1.7B model, but runs on consumer hardware
Hardware
| Platform |
Backend |
Speed |
| macOS (Apple Silicon) |
MPS |
Fast |
| Linux / Windows (NVIDIA) |
CUDA (bfloat16) |
Fastest |
| Any (CPU fallback) |
CPU (float32) |
Slow |
Auto-detected: CUDA → MPS → CPU.
Procedure
1. Install dependencies
pip install qwen-tts soundfile transformers accelerate torch
FlashAttention 2 is optional (CUDA only):
pip install flash-attn --no-build-isolation
2. Run voice clone
python skill/clone_voice.py \
--reference /path/to/speaker_sample.wav \
--text "Hello, this is my cloned voice." \
--output cloned.wav
| Flag |
Default |
Description |
-r, --reference |
(required) |
Path to reference audio |
-t, --text |
(required) |
Text to synthesize |
-o, --output |
output.wav |
Output file path |
-l, --language |
Auto |
Target language (see list above) |
First run downloads ~1.2 GB model from HuggingFace Hub — one-time only.
China users: Set HF_ENDPOINT=https://hf-mirror.com before first run.
Agent Integration
This skill can be loaded by any AI coding agent (Pi, Cursor, Copilot, etc.).
When loaded, the agent should:
- Check
python3 --version ≥ 3.10
- Ensure dependencies installed:
pip install qwen-tts soundfile transformers accelerate torch
- Locate the reference audio from user's message
- Run:
python skill/clone_voice.py -r <audio> -t <text> -o <out.wav> [-l <lang>]
- Report the output file path and duration
Pitfalls
- First-run download: ~1.2 GB from HuggingFace — 5–15 minutes. Warn the user.
- CPU is slow: ~5s of speech takes 30–60s. Set expectations.
- FlashAttention macOS:
flash-attn is CUDA-only; skip on macOS.
- Long text (>200 chars): may OOM on 8GB. Split into sentences.
- Poor reference audio: noisy, multi-speaker, or <3s samples produce bad
results. Use clean 10s+ single-speaker audio.
- Python version: requires 3.10+. Run
python3 --version first.
Verification
1---2name: qwen3-tts-voice-clone3description: Offline zero-shot voice cloning. Provide a reference audio sample and target text — outputs a WAV file in the cloned voice. No GPU required.4---56# Qwen3-TTS Voice Cloning (0.6B)78Zero-shot offline voice cloning powered by Alibaba's9[Qwen3-TTS](https://github.com/QwenLM/Qwen3-TTS) 0.6B model.1011## When to Use1213- User provides a reference voice sample (`.wav`, `.mp3`, `.flac`) + target text14- User asks to "clone my voice", "模仿这个声音说话", "声音克隆", "make X say Y"15- Offline / local-only operation is required — no cloud API calls16- Target languages: Chinese, English, Japanese, Korean, German, French,17 Russian, Portuguese, Spanish, Italian (+ `Auto` detection)1819### Boundaries2021- Does **not** handle video input — user must extract audio first22- Does **not** require the reference audio transcript (x_vector_only_mode)23- Reference audio: ideally ~10 seconds, clean, single speaker24- Quality is lower than the 1.7B model, but runs on consumer hardware2526## Hardware2728| Platform | Backend | Speed |29|----------|---------|-------|30| macOS (Apple Silicon) | MPS | Fast |31| Linux / Windows (NVIDIA) | CUDA (bfloat16) | Fastest |32| Any (CPU fallback) | CPU (float32) | Slow |3334Auto-detected: CUDA → MPS → CPU.3536## Procedure3738### 1. Install dependencies3940```bash41pip install qwen-tts soundfile transformers accelerate torch42```4344FlashAttention 2 is optional (CUDA only):4546```bash47pip install flash-attn --no-build-isolation48```4950### 2. Run voice clone5152```bash53python skill/clone_voice.py \54 --reference /path/to/speaker_sample.wav \55 --text "Hello, this is my cloned voice." \56 --output cloned.wav57```5859| Flag | Default | Description |60|------|---------|-------------|61| `-r`, `--reference` | *(required)* | Path to reference audio |62| `-t`, `--text` | *(required)* | Text to synthesize |63| `-o`, `--output` | `output.wav` | Output file path |64| `-l`, `--language` | `Auto` | Target language (see list above) |6566First run downloads ~1.2 GB model from HuggingFace Hub — one-time only.6768> **China users**: Set `HF_ENDPOINT=https://hf-mirror.com` before first run.6970## Agent Integration7172This skill can be loaded by any AI coding agent (Pi, Cursor, Copilot, etc.).73When loaded, the agent should:74751. Check `python3 --version` ≥ 3.10762. Ensure dependencies installed: `pip install qwen-tts soundfile transformers accelerate torch`773. Locate the reference audio from user's message784. Run: `python skill/clone_voice.py -r <audio> -t <text> -o <out.wav> [-l <lang>]`795. Report the output file path and duration8081## Pitfalls8283- **First-run download**: ~1.2 GB from HuggingFace — 5–15 minutes. Warn the user.84- **CPU is slow**: ~5s of speech takes 30–60s. Set expectations.85- **FlashAttention macOS**: `flash-attn` is CUDA-only; skip on macOS.86- **Long text** (>200 chars): may OOM on 8GB. Split into sentences.87- **Poor reference audio**: noisy, multi-speaker, or <3s samples produce bad88 results. Use clean 10s+ single-speaker audio.89- **Python version**: requires 3.10+. Run `python3 --version` first.9091## Verification9293- [ ] Output `.wav` file exists and is >1 KB94- [ ] Audio has recognizable speaker characteristics from reference95- [ ] Sample rate is 24000 Hz96- [ ] No Python traceback or CUDA/MPS errors in stderr