nano-voca-arabic
ultra-compact Arabic TTS
2 min read
The nano-voca-arabic model is an ultralightweight Text-to-Speech system for Modern Standard Arabic. With a size of just 1.2 million parameters, it is built on the tiny-voca architecture and trained from scratch on the same data with a reduced layer width. The model outputs high-quality 24 kHz audio, supporting 8 different voices across four styles (assistant, news, stories, promo). It is ideal for integration into lightweight applications where speed and minimal resource consumption are critical.
Key features
- Extreme speed: generation speeds reach ~330× real-time on four CPU threads using ONNX Runtime.
- Eight voices: four female and four male voices with support for four conversational styles.
- Minimal footprint: the PyTorch checkpoint is just 5 MB, and the ONNX version is 8 MB.
- Built-in waveform generator: the model does not require a separate neural vocoder to produce final audio.
What you can do
- Bot integration: voice Arabic text in Telegram bots or web applications with minimal latency.
- Low-end hardware deployment: run quality TTS on affordable servers or devices with limited CPU resources.
- Content voicing: generate podcasts, news, or educational audio materials by choosing the appropriate delivery style (for example, news or storytelling).
Example
Example of speech generation using ONNX Runtime:
import numpy as np, onnxruntime as ort, soundfile as sf
from tiny_voca_ar.numbers import expand_numbers
from tiny_voca_ar.text import phonemize
session = ort.InferenceSession("nano-voca-arabic/onnx/model.onnx", providers=["CPUExecutionProvider"])
phones = phonemize(expand_numbers("مرحبًا بكم في عالم الذكاء الاصطناعي."))
one = lambda v: np.array([v], dtype=np.float32)
voice = 1 # выбор голоса
audio, durations = session.run(None, {
"tokens": np.array([phones.ids], dtype=np.int64), "stress": np.array([phones.stress], dtype=np.int64),
"voice": np.array([voice], dtype=np.int64), "speed": one(1.0), "pitch_shift": one(0.0), "pitch_range": one(1.0)})
sf.write("hello.wav", audio[0], 24000)Read more
Details• Parameters: 1,155,211 (5 MB PyTorch, 8 MB ONNX).
• Performance: ~330× real-time on 4 CPU threads.
• Limitations: Modern Standard Arabic (MSA) only; dialects are read according to literary language rules.
• License: Apache-2.0.










Comments