Skip to content

Latest commit

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

███████╗ ██████╗██╗ ██╗ ██████╗ ███████╗███████╗
██╔════╝██╔════╝██║ ██║██╔═══██╗██╔════╝██╔════╝
█████╗ ██║ ███████║██║ ██║█████╗ ███████╗
██╔══╝ ██║ ██╔══██║██║ ██║██╔══╝ ╚════██║
███████╗╚██████╗██║ ██║╚██████╔╝███████╗███████║
╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝

Leave your voice behind — for the people who love you

Raw call recordings → on-device Android TTS · No cloud · No subscription · Forever

ColabPyTorchONNXPythonLicense


Why this exists

I had a thought one day: if I were to die right now, my loved ones would never hear my voice again.

Not a voicemail. Not a shaky video clip. Nothing intentional — just silence.

So I set out to fix that. I wanted to clone my voice from something I already had — a call recording, thirty seconds of me talking — and turn it into a model my family could carry on their phone forever. No internet. No company that might shut down. No subscription that lapses. Just my voice, still there, whenever they need it.

I found OmniVoice (zero-shot cloning from a short clip), then Piper (a real TTS model), then Sherpa-ONNX (fully on-device Android inference), then a TTS engine app on F-Droid that ties it all together. The pieces existed — they just weren't connected, and most of the official notebooks were broken.

So I connected them. Fixed the bugs. And built this.


What Echoes is

A 7-notebook Google Colab pipeline that takes raw call recordings and produces a voice model that runs fully on-device on Android — no internet required after export.

All you need is ~30 seconds of someone's voice from any call recording.

Built on Piper VITS + Sherpa-ONNX. Every stage runs on the free Colab T4 GPU.


Pipeline

┌──────────────────────────────────────────────────────────────────────────────────┐
│ │
│ [Raw Recordings — any call, any format] │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ 00 · Diarize│ pyannote.audio — speaker segmentation, resume-safe │
│ └──────┬──────┘ │
│ │ per-speaker WAV clips │
│ ▼ │
│ ┌─────────────┐ │
│ │ 01 · Clone │ OmniVoice zero-shot synthesis · faster-whisper transcription │
│ └──────┬──────┘ │
│ │ LJSpeech dataset (wavs/ + metadata.csv) │
│ ▼ │
│ ┌─────────────┐ │
│ │ 02 · Train │ Piper VITS fine-tune on hi_IN-rohan-medium │
│ └──────┬──────┘ │
│ │ last.ckpt + config.json → Google Drive │
│ ▼ │
│ ┌─────────────┐ │
│ │ 03 · Check │ Interactive PyTorch inference — validate before exporting │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ 04 · Export │ .ckpt → .onnx (all upstream bugs fixed — see below) │
│ └──────┬──────┘ │
│ │ voice-package.tar.gz │
│ ▼ │
│ ┌─────────────┐ │
│ │ 05 · Verify │ ONNX Runtime inference — standard + streaming models │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ 06 · Sherpa │ Metadata injection · tokens.txt · sherpa_model.tar.gz │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ [Android TTS — fully on-device, no internet, forever] │
│ │
└──────────────────────────────────────────────────────────────────────────────────┘

Notebooks

#NotebookWhat it doesKey libraries
0Diarize & ClipSpeaker diarization on raw recordings. Segments audio per speaker. Resume-safe progress tracking.pyannote.audio 3.1, ffmpeg
1Voice Clone → DatasetZero-shot synthesis of 100+ sentences in the cloned voice. Auto-transcription. LJSpeech output format.OmniVoice, faster-whisper large-v3
2Dataset → Piper CKPTFine-tunes hi_IN-rohan-medium Piper base model. TensorBoard logging. Checkpoint export to Drive.Piper VITS, PyTorch Lightning, piper-phonemize-fix
3Check the CKPTInteractive inference on the raw PyTorch checkpoint. Validates voice quality before ONNX export.Piper VITS, espeak-ng, ipywidgets
4Export to ONNXExports .ckpt.onnx. Rewrites broken upstream export scripts with all critical fixes applied.torch.onnx (opset 15), onnxscript
5Check ONNXValidates the exported model. Full encoder→decoder pipeline wired for streaming models.onnxruntime, piper-phonemize-fix
6Piper → Sherpa-ONNXInjects Sherpa-ONNX metadata into .onnx. Generates tokens.txt. Packages for Android deployment.sherpa-onnx, onnx metadata API

Bugs diagnosed & fixed

All of these were broken in the official Piper notebooks and diagnosed independently:

#BugRoot causeFix
1torch.onnx.export crashPyTorch 2.x defaults dynamo=True, which breaks dynamic_axes and None sid inputsExplicitly pass dynamo=False to force the legacy TorchScript exporter
2CPU/CUDA device mismatchModel loads to CUDA by default; dummy inputs are created on CPU — tracing failsmodel_g = model_g.cpu() before export
3Opset version wrong for SherpaOfficial notebook used opset_version=15 everywhere; Sherpa-ONNX requires opset 11opset_version=11 on the Sherpa export path
4PyTorch 2.6 checkpoint loadingDefault changed to weights_only=True, breaking Lightning's complex checkpoint objectsweights_only=False, strict=False in VitsModel.load_from_checkpoint
5Colab dependency conflictpiper-phonemize has broken Colab depsReplaced with piper-phonemize-fix throughout
6Streaming inference not wiredInference script detected encoder/decoder pairs but threw "not yet supported"Full encoder → decoder inference pipeline implemented
7Config file not detectedONNX inference only matched config.json, missing Piper's *.onnx.json namingAdded *.onnx.json glob to detect_onnx_models

Google Drive setup

My Drive/
└── Voicecloning/
├── raw_calls/ ← put your MP3 / WAV recordings here
├── clipped_audio/ ← Stage 0 output: per-speaker clips
└── training/
├── colab/piper/ ← checkpoints and config.json
└── piper-voice-packages/ ← exported .tar.gz voice packages

Prerequisites

HuggingFace token — required for pyannote/speaker-diarization-3.1 (Stage 0). Accept the model licence on HuggingFace, then paste your token into the notebook's Colab form field. No .env file needed.

Colab GPU runtime — Stages 1 and 2 need a T4 or better. The free tier works; training runs 6–12 hours. Stages 3–6 can run on CPU.

Google Drive (~2 GB free) — checkpoints, datasets, and exports save to Drive so they survive session restarts.


Android Deployment & Testing

The final sherpa_model.tar.gz can be used with any Sherpa-ONNX compatible Android application.

Recommended App for Testing:

Verified Devices:

  • Redmi 9A
  • Redmi K20 Pro
  • Poco F1

Tech stack

LayerTools
Diarizationpyannote.audio 3.1, ffmpeg
Voice synthesisOmniVoice (k2-fsa), faster-whisper large-v3
TTS architectureVITS via Piper (rmcpantoja fork)
TrainingPyTorch Lightning, piper-phonemize-fix, espeak-ng
Exporttorch.onnx TorchScript path, opset 11/15, onnxscript
On-device inferenceSherpa-ONNX, onnxruntime
PlatformGoogle Colab (free T4 GPU)

Credits


Amit Basuri · github.com/PositiveMatician · New Delhi

Built because voices shouldn't disappear. All upstream bug fixes (PyTorch 2.6 compat, ONNX export, Sherpa-ONNX conversion) diagnosed and implemented independently.

About

Echoes: A 7-stage Google Colab pipeline to clone voices from raw call recordings into fully on-device Android TTS models. No cloud, no subscriptions, forever.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages