Skip to content

About

Zero-Cost Neural Voice Clone Agent for Mac & Windows (F5-TTS Flow Matching + Kokoro-82M ONNX)

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Voice Clone Agent: Zero-Cost Neural Voice Synthesis (Mac & Windows)

An open-source, local-first voice cloning and speech synthesis agent. Run high-fidelity neural flow-matching (F5-TTS) and real-time offline text-to-speech (Kokoro-82M) directly on your machine without cloud subscriptions, API keys, or usage fees.


Capabilities

Feature Engine Hardware Typical Speed
Zero-Shot Voice Cloning F5-TTS Flow Matching Apple Silicon (MPS) / NVIDIA (CUDA) ~3-5s for 15s audio
Instant Offline Synthesis Kokoro-82M ONNX Any Mac / Windows PC (CPU / GPU) < 0.8s (Realtime 15x+)
Word-Level Subtitle Sync Faster-Whisper Local CPU (int8) < 1.0s
Studio Audio Mastering FFmpeg Chain CPU Real-time

Quick Start (Terminal)

1. 🍏 macOS (Apple Silicon M1/M2/M3/M4 & Intel)

Run the automated installer:

chmod +x setup_mac.sh
./setup_mac.sh

Or install manually in terminal:

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install torch torchaudio
pip install -r requirements.txt

2. 🪟 Windows (NVIDIA CUDA & CPU)

Run the installer:

setup_windows.bat

Or install manually:

python -m venv .venv
call .venv\Scripts\activate.bat
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt

CLI Usage

A. Clone Any Voice from a Reference Audio File

Provide a 5–15 second clean audio clip (.wav) along with its reference transcript:

python clone.py \
  --ref samples/reference_sample_1.wav \
  --ref-text "This is an open source demonstration of voice cloning and synthesis running entirely on a local personal computer." \
  --text "Welcome to the open-source voice cloning setup guide. We are running neural flow matching locally." \
  --out output.wav

B. Instant Offline Voice Generation (< 0.8s, No GPU)

Generate high-quality speech offline with zero GPU overhead:

python synth_kokoro.py \
  --voice af_bella \
  --text "Real-time speech synthesis running completely offline on your device." \
  --out instant.wav

C. Extract Word Timestamps for Subtitles

Generate precise word-level JSON timestamps for captions and editing:

python align.py --audio output.wav --out words.json

Agent Integration Mode

AI agents (such as autonomous CLI agents or background workers) can invoke this repository programmatically:

{
  "tool": "voice_clone",
  "command": "python clone.py --ref <audio_path> --ref-text <transcript> --text <target_script> --out <output_path>"
}

Agents can check hardware availability before launching synthesis:

import torch

device = "cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")
print(f"Agent using device: {device}")

Repository Structure

voice-clone-agent/
├── clone.py              # Main F5-TTS neural flow-matching cloner
├── synth_kokoro.py       # Ultra-fast Kokoro-82M offline synthesizer
├── align.py              # Word-level timestamp extractor (Faster-Whisper)
├── setup_mac.sh          # One-click automated macOS installer
├── setup_windows.bat     # One-click automated Windows installer
├── requirements.txt      # Dependency specification
├── samples/              # Royalty-free reference and demo audio files
│   ├── reference_sample_1.wav
│   ├── reference_sample_2.wav
│   ├── demo_cloned_output_1.wav
│   └── demo_cloned_output_2.wav
└── README.md

License

Open-source under the MIT License. Models are subject to their respective upstream licenses (Apache-2.0).

About

Zero-Cost Neural Voice Clone Agent for Mac & Windows (F5-TTS Flow Matching + Kokoro-82M ONNX)

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages