How ampixa/sanotts works
sanoTTS is a family of compact neural text-to-speech voices deployed through Python, browser/WASM, Arduino, ESPHome, mobile, and Home Assistant interfaces. The principal workflow is text input, language-appropriate phonemization, voice/model loading, neural inference, and PCM audio output. The Python engine and the documented browser path expose the clearest end-to-end flows; embedded runtimes and integrations are represented as distinct deployment branches. Some platform implementations are unsampled, so their internal links are limited to README statements and explicit source-index references.
Main entry points: engine.py Synthesizer · __init__.py Python API · snt_nano.c Nano inference · snt_voice.js Voice WASM
Components 24
Python Runtime
- Python API
pypkg/sanotts/__init__.py - Synthesizer
pypkg/sanotts/engine.py - Text frontend
pypkg/sanotts/frontend.py - Nano G2P
pypkg/sanotts/nano_g2p.py - Piper G2P
pypkg/sanotts/piper_g2p.py - Nano frontend
pypkg/sanotts/nano_frontend.py - Voice packs
pypkg/sanotts/voicepack.py - NumPy inference
pypkg/sanotts/models.py
Browser Runtime
- G2P WASM
web/snt_g2p.js - Chinese G2P
web/g2p-lazy/zh/zh_g2p.mjs - Chinese tables
web/g2p-lazy/zh/unicode_tables.mjs - Web TTS API
web/snt_tts.js - Voice WASM
web/snt_voice.js
Embedded Runtime
- Arduino API
arduino/src/SanoTTS.cpp - Nano inference
arduino/src/snt_nano.c - Nano interface
arduino/src/snt_nano.h
Platform Integrations
- ESPHome component
esphome/components/sanotts/sanotts.cpp - Lexicon G2P
esphome/components/sanotts/nano_lex_g2p.c - Home Assistant TTS
custom_components/sanotts/tts.py - Mobile binding
mobile/sanotts.c
Other components
- Text user
- Voice host
- Browser user
- PCM audio
Connections 23
- Text user → Python API: provides text
README.md - Python API → Synthesizer: calls
pypkg/sanotts/__init__.py - Synthesizer → Text frontend: uses
pypkg/sanotts/engine.py - Synthesizer → Nano G2P: dispatches
pypkg/sanotts/engine.py - Synthesizer → Piper G2P: dispatches
pypkg/sanotts/engine.py - Synthesizer → Nano frontend: uses
pypkg/sanotts/engine.py - Synthesizer → Voice packs: uses
pypkg/sanotts/engine.py - Synthesizer → NumPy inference: uses
pypkg/sanotts/engine.py - Voice packs → Voice host: downloads voices
README.md - Python API → PCM audio: returns audio
README.md - Browser user → G2P WASM: provides text
README.md - G2P WASM → Voice WASM: supplies phonemes
README.md - Browser user → Chinese G2P: provides Chinese
web/g2p-lazy/zh/zh_g2p.mjs - Chinese G2P → Chinese tables: reads
web/g2p-lazy/zh/zh_g2p.mjs - Web TTS API → Voice WASM: invokes
- Voice WASM → PCM audio: synthesizes
README.md - Text user → Arduino API: provides phonemes
- Arduino API → Nano inference: invokes
- Nano interface → Nano inference: defines interface
arduino/src/snt_nano.h - Nano inference → PCM audio: emits PCM
- ESPHome component → Lexicon G2P: uses G2P
- Home Assistant TTS → Python API: uses package
custom_components/sanotts/tts.py - Mobile binding → Nano inference: invokes