๐๏ธ Agent Skill โ Offline zero-shot voice cloning for AI coding agents. Drop a reference audio and some text. It speaks back in that voice. Powered by Alibaba's Qwen3-TTS 0.6B.
An agent skill โ a self-contained module that gives any AI coding agent the ability to clone voices offline. Wraps Qwen3-TTS 0.6B into a single CLI command:
User: "Clone this voice and say: Hello world"
Agent: [runs skill/clone_voice.py] โ output.wav โ
No cloud API keys. No GPUs required. Works on Mac, Linux, and Windows.
Compatible with any agent platform โ Pi, Cursor, Copilot, Claude Code, etc.
- ๐ค Zero-shot voice cloning โ one reference audio sample, no fine-tuning
- ๐ 10 languages โ Chinese, English, Japanese, Korean, German, French,
Russian, Portuguese, Spanish, Italian (+
Autodetection) - ๐ป CPU-friendly โ runs on CPU, MPS (Apple Silicon), or CUDA
- ๐ฆ Auto-download โ model (~1.2 GB) fetched from HuggingFace on first run
- ๐งฉ Agent-agnostic โ works with any agent that can run shell commands
Tell any AI coding agent:
"Install the clone-voice skill from
haoyiyin/clone-voice"
Your agent will clone, install dependencies, and configure the skill automatically. Works with Pi, Claude Code, Cursor, Codex, Copilot, and any agent supporting the Agent Skills specification.
# One-time setup
pip install qwen-tts soundfile transformers accelerate torchpython skill/clone_voice.py \
--reference speaker_sample.wav \
--text "Hello, this is my cloned voice." \
--output cloned.wavThe first invocation downloads ~1.2 GB of model weights from HuggingFace Hub. One-time only.
In China? Set
HF_ENDPOINT=https://hf-mirror.combefore the first run.
Once installed, your agent follows the specification in skill/SKILL.md automatically:
| User says | Agent does |
|---|---|
| "Clone this voice and say: ไฝ ๅฅฝไธ็" | Finds the audio, runs skill/clone_voice.py, returns the output |
| "Make this person say: I love coding" | Same flow, --language English |
| "็จ่ฟไธชๅฃฐ้ณ่ฏป่ฟๆฎต่ฏ" | Same, Chinese auto-detected |
| Platform | Backend | Speed |
|---|---|---|
| macOS (Apple Silicon) | MPS | โก Fast |
| Linux / Windows (NVIDIA) | CUDA (bfloat16) | โกโก Fastest |
| Any (CPU fallback) | CPU (float32) | ๐ข Slow (~30โ60s per 5s audio) |
Auto-detected at runtime.
usage: clone_voice.py [-h] --reference REFERENCE --text TEXT
[--output OUTPUT] [--language LANGUAGE]
options:
-r, --reference Path to reference audio (WAV, MP3, FLAC, etc.)
-t, --text Text to synthesize with the cloned voice
-o, --output Output WAV path (default: output.wav)
-l, --language Target language (default: Auto)
Choices: Auto, Chinese, English, Japanese, Korean,
German, French, Russian, Portuguese,
Spanish, Italian
- Duration: ~10 seconds recommended (3s minimum)
- Quality: Clean, single speaker, minimal background noise
- Format: WAV, MP3, FLAC โ anything
soundfilecan read
| Component | Details |
|---|---|
| Model | Qwen/Qwen3-TTS-12Hz-0.6B-Base |
| Framework | Qwen3-TTS (Apache 2.0) |
| Runtime | Python 3.10+, PyTorch, Transformers |
| Output | 24 kHz mono WAV |
clone-voice/
โโโ README.md
โโโ skill/
โ โโโ SKILL.md # Agent skill specification
โ โโโ clone_voice.py # CLI inference script
โ โโโ requirements.txt # Python dependencies
โโโ .gitignore
Apache 2.0 โ matching the upstream Qwen3-TTS license.