Text to speech with voice cloning
Project description
Speaky
Text‑to‑Speech with Voice Cloning made easy with Chatterbox TTS Generate natural‑sounding speech from plain text—locally on your GPU/CPU using a single, ergonomic command‑line tool.
Features
- Voice cloning from a short audio prompt (optional)
- Built‑in voices accessible via
-v NAME(or-v ALLfor every voice) - Emotion control via exaggeration & classifier‑free guidance
- Device auto‑detection — Apple Silicon (mps), CUDA GPUs, or CPU
- Smart sentence chunking (NLTK) to handle long passages gracefully
- Trailing‑silence trimming so outputs end crisply
- Glitch / clipping detection heuristic for cleaner audio
- Verification via transcription (Distil‑Whisper) to catch missing words
Quick Start
uv tool install speaky
🚀 Quickstart (CLI)
The CLI exposes a single command:
speak.
| Task | Command |
|---|---|
| Say a sentence | speak "Hello, world!" |
| Batch from a file | speak -f script.txt -o voiceovers/ |
| Clone a voice | speak "How do I sound?" --voice my_prompt.wav |
| Use built-in voice | speak "Join me" -v vader |
| All built-in voices | speak "Join me" -v ALL |
| Dial up the drama | speak "This is **exciting**!" --exaggeration 1.2 |
All outputs are MP3 files named after the text (or file stem) and saved to the current directory unless you pass --output-dir.
Common flags
--cfg-weight FLOAT• classifier‑free guidance mix (0‑1)--max-chars INT• soft limit per chunk (450)--save-chunks• keep intermediate WAVs for debugging--overwrite• replace existing files
Run speak --help for the full list.
🐍 Python API
from pathlib import Path
from speaky.core import batch_synthesize
batch_synthesize(
inputs=[("Hello there!", "greeting")], # (text, stem)
output_dir=Path("out"),
)
The helper wraps all the goodies—chunking, glitch detection, transcription verification, etc.—while caching the heavy TTS model for speed.
Credit
This project is built on top of chatterbox open-source TTS.
Development
Quick Commands
make initcreate the environment and install dependenciesmake helpsee available commandsmake afformat codemake lintrun lintermake typecheckrun type checkermake testrun testsmake checkrun all checks (format, lint, typecheck, test)uv add pkgadd a python dependencyuv run -- python foo/bar.pyrun arbitrary command in python env
Code Conventions
- Always run
make checkuafter making changes.
Testing
- Use pytest (no test classes).
- Always set
match=inpytest.raises. - Prefer
monkeypatchover other mocks. - Mirror the source-tree layout in
tests/.
Exceptions
- Catch only specific exceptions—never blanket
except:blocks. - Don't raise bare
Exception.
Python
- Manage env/deps with uv (
uv add|remove,uv run -- ...). - No logging config or side-effects at import time.
- Keep interfaces (CLI, web, etc.) thin; put logic elsewhere.
- Use
typerfor CLI interfaces,fastapifor web interfaces, andpydanticfor data models.
Project details
Release history Release notifications | RSS feed
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 speaky-0.1.0.tar.gz.
File metadata
- Download URL: speaky-0.1.0.tar.gz
- Upload date:
- Size: 4.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
197b8b3f75e34e328b1381906484577c37789751285618b2dbb659e6b439b4a7
|
|
| MD5 |
9fd0a88390d95bf0256984a0942c8540
|
|
| BLAKE2b-256 |
25def1b4b3ef63da910c441491cbdb2afd3af5919b34816c8b0396459d200bea
|
File details
Details for the file speaky-0.1.0-py3-none-any.whl.
File metadata
- Download URL: speaky-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
812f07a9b8e8213a3b424e329caae14c7215b459dc290b8cab13045d58de46cc
|
|
| MD5 |
1d4b94367144d007878fbb15e59ef0df
|
|
| BLAKE2b-256 |
987f5283aaf5f27d26f11537228ab2dccb3b839be1445e26757f474649a1377e
|