Skip to content

haoyiyin/clone-voice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Qwen3-TTS Voice Clone โ€” Agent Skill

๐ŸŽ™๏ธ 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.

License Python Agent Skill


What is this?

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.

Features

  • ๐ŸŽค Zero-shot voice cloning โ€” one reference audio sample, no fine-tuning
  • ๐ŸŒ 10 languages โ€” Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian (+ Auto detection)
  • ๐Ÿ’ป 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

Quick Start

1. Install

๐Ÿค– Via AI Agent (Recommended)

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.

๐Ÿ› ๏ธ Manual Installation

# One-time setup
pip install qwen-tts soundfile transformers accelerate torch

2. Clone a voice

python skill/clone_voice.py \
  --reference speaker_sample.wav \
  --text "Hello, this is my cloned voice." \
  --output cloned.wav

3. First run downloads the model

The first invocation downloads ~1.2 GB of model weights from HuggingFace Hub. One-time only.

In China? Set HF_ENDPOINT=https://hf-mirror.com before the first run.

Agent Usage

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

Hardware

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.

CLI Reference

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

Reference Audio Tips

  • Duration: ~10 seconds recommended (3s minimum)
  • Quality: Clean, single speaker, minimal background noise
  • Format: WAV, MP3, FLAC โ€” anything soundfile can read

Tech Stack

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

File Structure

clone-voice/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ skill/
โ”‚   โ”œโ”€โ”€ SKILL.md           # Agent skill specification
โ”‚   โ”œโ”€โ”€ clone_voice.py     # CLI inference script
โ”‚   โ””โ”€โ”€ requirements.txt   # Python dependencies
โ””โ”€โ”€ .gitignore

License

Apache 2.0 โ€” matching the upstream Qwen3-TTS license.

About

๐ŸŽ™๏ธ Agent Skill โ€” Offline zero-shot voice cloning with Qwen3-TTS 0.6B. Drop a reference audio + text, get cloned speech. CPU/MPS/CUDA, 10 languages.

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages