Personalised voice cloning + TTS
Train on your own recordings – then turn any text into speech that sounds like you.
- Features
- Quick Start
- Installation
- Usage
- Directory Layout
- Troubleshooting & Tips
- Contributing
- License
- Acknowledgements
- OpenVoice V2 tone-colour converter
- MeloTTS multilingual base TTS (EN · ES · FR · ZH · JA · KO …)
- Simple CLI –
train,synthesize,train_and_synthesize - Works with one or many MP3 samples (more = better)
- Pure-Python, GPU-accelerated (falls back to CPU)
- Clean, class-based code; easy to extend
Five-minute demo (Linux / macOS / WSL)
git clone https://github.com/shamspias/VocalTwin.git
cd VocalTwin
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python -m unidic download # one-time
# download OpenVoice V2 checkpoints (~600 MB)
curl -L https://myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip -o ckpt.zip
unzip ckpt.zip -d checkpoints_v2 && rm ckpt.zip
# drop a few clean MP3s into audio_samples/ (≈30-60 s total audio)
# create texts/hello.txt with some text
python main.py train_and_synthesize --language EN
# → outputs/hello.wav (your voice!)Prerequisites
- Python 3.9 – 3.10
ffmpegin yourPATH- NVIDIA GPU with CUDA 11+ recommended (CPU works, just slower)
# clone + create venv
git clone https://github.com/shamspias/VocalTwin.git
cd VocalTwin
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# install deps
pip install --upgrade pip
pip install -r requirements.txt
python -m unidic download # for Japanese tokeniser
# fetch OpenVoice V2 converter checkpoints
mkdir -p checkpoints_v2
curl -L https://myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip -o ckpt.zip
unzip ckpt.zip -d checkpoints_v2 && rm ckpt.zipPut MP3s in audio_samples/ (more = better):
python main.py trainCreates checkpoints/target_se.pth – your speaker embedding.
Add one or more .txt files to texts/ and run:
python main.py synthesize --language EN # EN / ES / FR / ZH / JA / KOEach .txt → .wav with your voice in outputs/.
python main.py train_and_synthesize --language ENpython main.py --helpusage: VocalTwin [-h] [--audio_dir AUDIO_DIR] [--text_dir TEXT_DIR]
[--checkpoint_dir CHECKPOINT_DIR] [--output_dir OUTPUT_DIR]
[--language LANGUAGE]
{train,synthesize,train_and_synthesize}
Positional arguments:
{train,synthesize,train_and_synthesize}
Action to perform
Optional arguments:
--audio_dir AUDIO_DIR MP3 training recordings [audio_samples]
--text_dir TEXT_DIR Input .txt files [texts]
--checkpoint_dir CHECKPOINT_DIR
Model checkpoints + target SE [checkpoints]
--output_dir OUTPUT_DIR Generated WAVs [outputs]
--language LANGUAGE TTS language code (MeloTTS) [EN]
VocalTwin/
├── audio_samples/ # your MP3 recordings
├── texts/ # input .txt
├── outputs/ # generated WAV
├── checkpoints/ # target_se.pth lives here
├── checkpoints_v2/ # OpenVoice converter checkpoints
├── src/
│ ├── trainer.py # extracts speaker embedding
│ ├── synthesizer.py # TTS + tone-colour conversion
│ └── utils.py # helpers (placeholder)
├── main.py # CLI
└── requirements.txt
- Noise matters – recordings should be clear, 16 kHz+ preferred.
- Short texts (< 3 s) sometimes clip; add punctuation or line-breaks.
- On CPU the conversion step is slow; expect ~1 × RT or worse.
- “
target_se.pth not found”? Run thetrainstep first or check paths.
Bug reports & PRs are welcome!
- Fork → feature branch → PR to
main - Follow the existing code style (black + isort).
- Add/update docstrings and a short demo if introducing a new feature.
VocalTwin is released under the MIT License – see LICENSE.
- OpenVoice V2 – tone-colour converter
- MeloTTS – multilingual neural TTS
- Demo recordings courtesy of the open-source speech community
Made with Frustration 🫤 by @shamspias