tiny-voca Kiswahili
a lightweight offline Swahili text-to-speech model
2 min readupdated
This compact text-to-speech (TTS) model for Swahili has just 4.54 million parameters, built to run directly on low-end mobile devices like Android smartphones without cloud connectivity. Based on the tiny-voca architecture (a source-filter vocoder with a duration block), the model is exported to the ONNX format and takes up about 21.4 MB. It generates high-quality Swahili speech supporting seven fixed voices. The solution is ideal for mobile app and screen reader developers who need a fully autonomous voice engine with minimal RAM usage.
Key features
- Mobile optimization: runs stably on budget Android smartphones with minimal RAM consumption (71–75 MB).
- High speed: CPU speech synthesis with a real-time factor (RTF) between 0.16 and 0.21.
- Precise duration alignment: outputs phoneme durations directly during generation, making it easy to implement synchronized text highlighting.
- Compact size: weighs only 21.4 MB in ONNX format and operates without heavy cloud servers.
What you can do
- Mobile app integration: embed offline text voiceovers into local apps and readers for Swahili-speaking users.
- Text-highlighting systems: build interactive reading tools for constitutions or educational materials with real-time visual highlighting of spoken words.
- Autonomous voice bots: deploy a lightweight audio generation system on inexpensive server CPUs or local devices without a GPU.
Example
An example of running model inference using the ONNX Runtime library in Python:
import numpy as np, onnxruntime as ort
sess = ort.InferenceSession("swahili.onnx", providers=["CPUExecutionProvider"])
audio, durations = sess.run(None, {
"tokens": np.array([tokens], dtype=np.int64),
"stress": np.array([stress], dtype=np.int64),
"voice": np.array([0], dtype=np.int64),
"speed": np.array([1.0], dtype=np.float32),
"pitch_shift": np.array([0.0], dtype=np.float32),
"pitch_range": np.array([1.0], dtype=np.float32),
})
Read more
DetailsArchitecture: source-filter vocoder with duration block, 4 encoder slots
Parameters and size: 4.54M parameters, 21.4 MB (ONNX, fp32)
Sample rate: 24 kHz
Limitations: up to 512 tokens and 32 seconds of audio per call; numbers and abbreviations require preliminary text expansion
License: CC-BY-SA-4.0 (weights and WAXAL dataset)










Comments