Skip to main content

spch

Local voice-cloning pipeline using F5-TTS for zero-shot synthesis.

Zero-shot voice cloning, speech-to-text, and text-to-speech — all running locally on your machine.

PyPI version Python License: MIT Platforms


spch is a command-line tool that lets you clone any voice from a short audio sample, transcribe audio and video to text, and synthesize speech that sounds like the original speaker — entirely on your own hardware. No cloud APIs, no subscription fees, no data leaving your machine.

It pairs F5-TTS for high-quality zero-shot voice cloning with faster-whisper for fast transcription, and optionally hooks into Ollama for LLM-powered transcript cleanup.

✨ Features

  • Voice Profile Creation — Extract a clean reference voice from any audio or video file (MP3, MP4, WAV, FLAC, M4A, MKV, MOV, and more).
  • Zero-Shot Voice Cloning — Synthesize speech in any cloned voice using F5-TTS. No training required — a 5–15 second sample is enough.
  • Speech-to-Text — Transcribe audio or video to TXT, SRT, VTT, and JSON — all in a single command.
  • Ollama Integration — Optional LLM-powered transcription cleanup that fixes punctuation and removes filler words.
  • Atomic Writes — Profiles and outputs are written atomically, so a crash never leaves you with a half-written file.
  • Progress Indicators — Rich spinners and tables keep you informed during every long-running operation.
  • GPU Acceleration — Automatic CUDA and Apple Silicon (MPS) detection for faster inference when available.

🧠 How It Works

spch operates on a simple three-step model:

   ┌─────────────┐     ┌──────────────────┐     ┌──────────────────┐
   │  Audio/Video │────▶│  Voice Profile   │────▶│  Cloned Speech   │
   │  (any file)  │     │  (reference.wav) │     │  (F5-TTS synth)  │
   └─────────────┘     └──────────────────┘     └──────────────────┘
         │                                           ▲
         │              ┌──────────────┐             │
         └─────────────▶│ Transcription │────────────┘
                        │ (faster-      │   (reference text
                        │  whisper)     │    feeds the clone)
                        └──────────────┘
  1. Create a voice profile from an audio or video clip — spch extracts a clean reference sample and transcribes what's being said.
  2. Transcribe any media file to text in multiple formats.
  3. Synthesize new speech in the cloned voice from typed text or a script file.

📋 Requirements

Requirement Required? Notes
Python ≥ 3.10 Yes
ffmpeg Yes Used for all audio/video extraction and conversion
Ollama Optional Enables LLM-powered transcription cleanup
CUDA GPU Optional Speeds up TTS and transcription (falls back to CPU automatically)

🚀 Getting Started

1. Install ffmpeg

ffmpeg is required for audio and video processing.

# macOS (Homebrew)
brew install ffmpeg

# Ubuntu / Debian
sudo apt install ffmpeg

# Windows (winget)
winget install Gyan.FFmpeg

# Windows (Chocolatey)
choco install ffmpeg

Verify it's available:

ffmpeg -version

2. Install spch

Option A — Install as a global tool (recommended for end users):

# With pip
pip install spch

# With uv
uv tool install spch

After installation, the spch command is available everywhere on your system.

⚡ Quick Examples

# Clone a voice from a video, taking the first 10 seconds
spch profile create -n narrator -i intro.mp4 --duration 10

# List your saved voices
spch profile list

# Inspect a profile
spch profile info narrator

# Synthesize an MP3 from inline text
spch speak -p narrator -t "Welcome to the show." --fmt mp3

# Transcribe in Spanish
spch transcribe -i entrevista.mp3 -l es -f srt

# Delete a profile without confirmation prompt
spch profile delete oldvoice --force

📖 Command Overview

Command Description
spch configure Interactive setup wizard (devices, formats, Ollama, storage)
spch status Check dependencies, configuration, and profile count
spch profile create Create a voice profile from an audio or video file
spch profile list List all saved voice profiles
spch profile info <name> Show detailed information about a profile
spch profile delete <name> Delete a voice profile
spch transcribe Convert speech (audio/video) to text in multiple formats
spch speak Synthesize speech from text using a voice profile

For every flag, option, default value, and usage scenario, see the Command Reference ⟶

⚙️ Configuration

All settings are stored in ~/.spch/config.json and loaded on every invocation. Run spch configure to change them interactively. Key settings:

Setting Default Options
TTS compute device auto auto · cuda · cpu · mps
TTS output format wav wav · mp3 · flac
TTS NFE steps 32 Higher = better quality, slower
Whisper model base tiny · base · small · medium · large-v3
Whisper device auto auto · cuda · cpu
Whisper language en Any language code, or auto
Transcription outputs txt, srt Any of txt · srt · vtt · json
Ollama host http://localhost:11434 Any Ollama server URL
Ollama text cleanup true true · false

📁 Storage Layout

Everything spch creates lives under ~/.spch/ by default:

~/.spch/
├── config.json                  # Configuration
├── profiles/
│   └── myvoice/
│       ├── profile.json         # Metadata + reference text       └── reference.wav        # Reference audio (5–15 s)
└── outputs/
    ├── transcriptions/
       └── recording/
           ├── recording.txt
           ├── recording.srt
           └── recording_cleaned.txt   # If Ollama cleanup is enabled
    └── synthesis/
        ├── speech_a1b2c3d4.wav         # Inline --text output
        └── script/                     # --file output (one file per line)
            ├── script_001.wav
            └── script_002.wav

You can change the profiles and outputs directories with spch configure.

🎧 Supported Formats

Input (voice profile creation & transcription):

Type Extensions
Audio .mp3 .wav .flac .m4a .aac .ogg .opus .wma
Video .mp4 .mkv .avi .mov .webm .flv .wmv

Output:

Operation Formats
Speech synthesis wav · mp3 · flac
Transcription txt · srt · vtt · json

🔧 Troubleshooting

ffmpeg is required but not found

Install ffmpeg using the instructions in Getting Started, then verify with ffmpeg -version. spch needs both ffmpeg and ffprobe on your PATH.

Ollama not running — skipping cleanup

Transcription cleanup is optional. If you want it, install and start Ollama:

# Install: https://ollama.com
ollama serve          # start the server
ollama pull llama3.2  # pull a model

Then re-run spch configure to select the model. If you don't want cleanup, run transcription with --no-cleanup or disable it in spch configure.

Synthesis is slow / using CPU instead of GPU

Run spch status to see which device PyTorch is using. If you have an NVIDIA GPU but it shows "CPU", make sure you have CUDA-enabled PyTorch installed. Set the device explicitly with spch configure → Compute device → cuda.

First synthesis takes a long time

The first spch speak call downloads the F5-TTS model weights (~1 GB) from Hugging Face. Subsequent calls load the cached model and are much faster.

Running with uv run — "Failed to spawn" error

If you installed spch from source and run it through uv run, remember that subcommands belong to the spch program — not uv run:

# Wrong — "configure" is not a standalone program
uv run configure

# Correct
uv run spch configure
uv warning: "Failed to hardlink files"

This happens when the uv cache and your project live on different drives/filesystems. It's harmless, but you can silence it by adding this to your pyproject.toml:

[tool.uv]
link-mode = "copy"

Or set the environment variable UV_LINK_MODE=copy.

📚 Documentation

  • COMMAND.md — Complete command reference with every flag, option, default, and real-world scenario recipes.

📄 License

MIT — see the LICENSE file for details.

Option B — Run directly from a project clone (for development):

git clone https://github.com/spch-contributors/spch.git
cd spch
uv sync
# Prefix all commands with "uv run", e.g.:
uv run spch --help

3. Configure

Run the interactive setup wizard once before first use:

spch configure

This walks you through choosing storage directories, compute devices (CPU/CUDA/MPS), output formats, Whisper model size, and Ollama settings. You can re-run it any time to change something.

4. Check your system

spch status

This verifies that ffmpeg, F5-TTS, faster-whisper, and PyTorch are installed and reports your active compute device. It also shows your current configuration and how many voice profiles you have.

5. Create your first voice profile

spch profile create --name myvoice -i recording.mp3

spch extracts a clean reference sample (trims to 15 seconds by default), transcribes the reference text, and saves the profile. The first run also downloads the F5-TTS model weights (~1 GB).

6. Synthesize speech in the cloned voice

# From inline text
spch speak -p myvoice -t "Hello, this is my cloned voice speaking!"

# From a script file (one utterance per line)
spch speak -p myvoice -F script.txt

7. Transcribe audio or video

# Transcribe to SRT + TXT
spch transcribe -i meeting.mp4 -f srt,txt

# Transcribe to all formats, skip Ollama cleanup
spch transcribe -i podcast.mp3 -f txt,srt,vtt,json --no-cleanup

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spch-0.1.0.tar.gz (374.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spch-0.1.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file spch-0.1.0.tar.gz.

File metadata

  • Download URL: spch-0.1.0.tar.gz
  • Upload date:
  • Size: 374.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 904cb207b8e9171f4bc6dcc3ace4ab16e9a8f70cec3e7e3fc620e1b7e9513c92
MD5 5dfd3441c1be1fd3f7618078d6166c00
BLAKE2b-256 af7f8e54a4fb9cfe7a7cacb752949f46348d48658c8fa3718aca05ae74ba1878

See more details on using hashes here.

Provenance

The following attestation bundles were made for spch-0.1.0.tar.gz:

Publisher: deploy.yaml on devcrypted/spch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32abbc15d4498209ae107e1f64304cc61b16e2fd00c74cf2c2cdc1312374b7bd
MD5 189e41bcbf1726395c8d65d099c8f7b2
BLAKE2b-256 3168448720d37324d7eaa3adda81b77c3ece7abbd943ea5faacedbba11193df9

See more details on using hashes here.

Provenance

The following attestation bundles were made for spch-0.1.0-py3-none-any.whl:

Publisher: deploy.yaml on devcrypted/spch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page