Files changed (1) hide show
  1. README.md +36 -9
README.md CHANGED
@@ -96,8 +96,8 @@ model-index:
96
 
97
  ### Vietnamese Zero-Shot Text-to-Speech (TTS) with real-time streaming and voice cloning from seconds of audio. Fast, natural, and optimised for CPU inference.
98
 
99
- **The most accurate open Vietnamese TTS we know of — 13× fewer word errors than
100
- the next open model**, and it runs faster than real time on a laptop CPU.
101
 
102
  * 🎯 **Ultra-natural** — 2.91 UTMOS, ~0.5 MOS above every other open Vietnamese
103
  system, with near-zero dead air (0.029 s vs 0.23–0.53 s).
@@ -107,7 +107,7 @@ the next open model**, and it runs faster than real time on a laptop CPU.
107
  * ⚡ **Real-time on CPU, streaming** — ~2× faster than real time (RTF 0.5×),
108
  first audio chunk in ~70 ms. No GPU required.
109
  * 🇻🇳 **Built for Vietnamese** — tones, code-switched English, and a built-in
110
- normalizer that reads `31/12/2025` and `1.250 tỷ` the way a person would.
111
 
112
  * Code, examples, browser demo: **https://github.com/zeroweight-ai/ZeroTTS**
113
  * Benchmark dataset: **https://huggingface.co/datasets/zeroweight-ai/ZeroBench-TTS**
@@ -127,8 +127,33 @@ tts.save_audio(audio, "out.wav")
127
  Streaming, with first audio in roughly 70 ms:
128
 
129
  ```python
130
- for chunk in tts.synthesize_stream("Một đoạn văn bản dài hơn…", voice="maichi"):
131
- play(chunk) # (1, n) float32 at 48 kHz
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  ```
133
 
134
  ## Benchmarks
@@ -146,11 +171,13 @@ spoken out, from the benchmark's own curated reading.
146
  | **Dead air** (excess silence) ↓ | **0.029 s** | 0.386 s | 0.568 s | 0.215 s |
147
  | **RTF, CPU** ↓ | **0.50×** | 6.12× | 0.71× | 0.73× |
148
  | **Time to first audio, CPU** ↓ | **~70 ms** | ~34 s | ~6.1 s | ~5.1 s |
149
- | Size | **81 M**, CPU | 3.1 GB, GPU | 1.9 GB, GPU | 1.9 GB, GPU |
150
 
151
- **4× fewer word errors than the next-best system**, and the only one of the four
152
- that's actually fast on CPU the others are sized and tuned for a GPU, and it
153
- shows.
 
 
154
 
155
  Full comparison tables, per-subset breakdowns, and CPU speed methodology:
156
  **[docs/BENCHMARKS.md](https://github.com/zeroweight-ai/ZeroTTS/blob/main/docs/BENCHMARKS.md)**
 
96
 
97
  ### Vietnamese Zero-Shot Text-to-Speech (TTS) with real-time streaming and voice cloning from seconds of audio. Fast, natural, and optimised for CPU inference.
98
 
99
+ **The most accurate open Vietnamese TTS we know of — 4× fewer word errors than
100
+ the next best model**, and it runs faster than real time on a laptop CPU.
101
 
102
  * 🎯 **Ultra-natural** — 2.91 UTMOS, ~0.5 MOS above every other open Vietnamese
103
  system, with near-zero dead air (0.029 s vs 0.23–0.53 s).
 
107
  * ⚡ **Real-time on CPU, streaming** — ~2× faster than real time (RTF 0.5×),
108
  first audio chunk in ~70 ms. No GPU required.
109
  * 🇻🇳 **Built for Vietnamese** — tones, code-switched English, and a built-in
110
+ normalizer that reads `31/12/2025` and `ZeroTTS` the way a person would.
111
 
112
  * Code, examples, browser demo: **https://github.com/zeroweight-ai/ZeroTTS**
113
  * Benchmark dataset: **https://huggingface.co/datasets/zeroweight-ai/ZeroBench-TTS**
 
127
  Streaming, with first audio in roughly 70 ms:
128
 
129
  ```python
130
+ import queue
131
+
132
+ import numpy as np
133
+ import sounddevice as sd # pip install sounddevice
134
+
135
+ TEXT = ("Đây là chế độ phát trực tuyến. Âm thanh được tạo ra và phát ngay lập tức, "
136
+ "không cần chờ toàn bộ đoạn văn hoàn thành. Nhờ vậy, người nghe chỉ mất "
137
+ "khoảng 70 mili giây là đã nghe thấy câu đầu tiên, ngay cả khi mô "
138
+ "hình đang chạy trên CPU của một chiếc laptop bình thường.")
139
+
140
+ pending, tail = queue.Queue(), np.zeros(0, dtype="float32")
141
+
142
+ def feed(outdata, frames, _time, _status):
143
+ global tail
144
+ while len(tail) < frames and not pending.empty():
145
+ tail = np.concatenate([tail, pending.get_nowait()])
146
+ n = min(frames, len(tail))
147
+ outdata[:n, 0] = tail[:n]
148
+ outdata[n:] = 0
149
+ tail = tail[n:]
150
+
151
+ with sd.OutputStream(samplerate=tts.sample_rate, channels=1,
152
+ dtype="float32", callback=feed):
153
+ for chunk in tts.synthesize_stream(TEXT, voice="maichi"):
154
+ pending.put(chunk.reshape(-1)) # chunk is (1, n) float32 at 48 kHz
155
+ while not pending.empty() or len(tail):
156
+ sd.sleep(50) # let the buffer drain before closing
157
  ```
158
 
159
  ## Benchmarks
 
171
  | **Dead air** (excess silence) ↓ | **0.029 s** | 0.386 s | 0.568 s | 0.215 s |
172
  | **RTF, CPU** ↓ | **0.50×** | 6.12× | 0.71× | 0.73× |
173
  | **Time to first audio, CPU** ↓ | **~70 ms** | ~34 s | ~6.1 s | ~5.1 s |
174
+ | Size | **202 M** params, 0.86 GB fp32, CPU | 3.1 GB, GPU | 1.9 GB, GPU | 1.9 GB, GPU |
175
 
176
+ **4× fewer word errors than the next-best system**, and the fastest of the four
177
+ on CPU. The gap is much wider in latency than in throughput: the two XTTS
178
+ fine-tunes also beat real time (0.71×) but need seconds to emit their first
179
+ sample, while OmniVoice is 6× *slower* than real time. All three are sized and
180
+ tuned for a GPU, and it shows.
181
 
182
  Full comparison tables, per-subset breakdowns, and CPU speed methodology:
183
  **[docs/BENCHMARKS.md](https://github.com/zeroweight-ai/ZeroTTS/blob/main/docs/BENCHMARKS.md)**