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.
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)
└──────────────┘
- Create a voice profile from an audio or video clip — spch extracts a clean reference sample and transcribes what's being said.
- Transcribe any media file to text in multiple formats.
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spch-0.1.2.tar.gz.
File metadata
- Download URL: spch-0.1.2.tar.gz
- Upload date:
- Size: 375.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07598433d676bfef4014d8e3645b11d5ca28e1122c083b93723699df6fa8e854
|
|
| MD5 |
1720cdf1cbbacca5c1eb0e150b7ede9d
|
|
| BLAKE2b-256 |
5b977a99ab39f07cdd6dbc3a70df41df76d9cf810a1b422edcd68c23fae9c94e
|
Provenance
The following attestation bundles were made for spch-0.1.2.tar.gz:
Publisher:
deploy.yaml on devcrypted/spch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spch-0.1.2.tar.gz -
Subject digest:
07598433d676bfef4014d8e3645b11d5ca28e1122c083b93723699df6fa8e854 - Sigstore transparency entry: 2313029768
- Sigstore integration time:
-
Permalink:
devcrypted/spch@2441535d61916f3a471742e9809119b833d1f7e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/devcrypted
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@2441535d61916f3a471742e9809119b833d1f7e8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file spch-0.1.2-py3-none-any.whl.
File metadata
- Download URL: spch-0.1.2-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b1146ff8e9f4ed32486be7d773d3a3df26c6c16aa63e197d008eef38de54242
|
|
| MD5 |
4570b0badbf403bbcbd8f0056988ec17
|
|
| BLAKE2b-256 |
d4598eda152a488904d2acc5c71bbff62dcb00d71e5dab74582936217e14864e
|
Provenance
The following attestation bundles were made for spch-0.1.2-py3-none-any.whl:
Publisher:
deploy.yaml on devcrypted/spch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spch-0.1.2-py3-none-any.whl -
Subject digest:
5b1146ff8e9f4ed32486be7d773d3a3df26c6c16aa63e197d008eef38de54242 - Sigstore transparency entry: 2313029836
- Sigstore integration time:
-
Permalink:
devcrypted/spch@2441535d61916f3a471742e9809119b833d1f7e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/devcrypted
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@2441535d61916f3a471742e9809119b833d1f7e8 -
Trigger Event:
workflow_dispatch
-
Statement type: