File size: 4,433 Bytes
b5c6ae8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | ---
license: apache-2.0
language:
- de
pipeline_tag: text-to-speech
library_name: onnx
tags:
- tts
- text-to-speech
- german
- onnx
- cpu
- tiny-voca
- vocos
---
# apptor-tiny-tts (German)
A tiny German text-to-speech model that runs on the CPU: **4.5M parameters, one 21 MB ONNX file**, about 40x faster
than real time on four CPU threads. Two voices: `F2` (female) and `M2` (male), 24 kHz.
It is built on **[tiny-voca](https://github.com/n4ze3m/tiny-voca) by n4ze3m**: same architecture and training
recipe, retrained from scratch for German. This is **not an official tiny-voca release**. Thanks to n4ze3m for the
model and the idea.
An optional second stage, a [Vocos](https://github.com/gemelo-ai/vocos) vocoder fine-tuned on the two voices
(13.5M parameters, 54 MB), re-synthesises the waveform and removes most of the buzzy sound of the tiny built-in
generator. It is still real time on the CPU (~20x).
Listen: `samples/demo.wav` (with Vocos) and `samples/demo-without-vocos.wav`.
## Files
| file | what | license |
|---|---|---|
| `apptor-tiny-tts-de.onnx` | the TTS model (text tokens -> 24 kHz audio) | Apache-2.0 |
| `apptor-tiny-tts-de.json` | sample rate, voices, phoneme symbols, limits | Apache-2.0 |
| `apptor-tiny-tts-vocos-de.pt` | optional: Vocos state dict, fine-tuned from `charactr/vocos-mel-24khz` | MIT |
| `tinyvoca/` | German text front end (eSpeak NG phonemes, number normalisation), from tiny-voca | Apache-2.0 |
| `speak.py` | minimal example | Apache-2.0 |
## Use
Needs the `espeak-ng` program (`apt install espeak-ng`; GPL-3.0, called as a separate process) and
`pip install onnxruntime numpy soundfile num2words`.
```bash
python speak.py "Am 3. Mai um 18:30 Uhr kostet das Ticket 12,50 Euro." --voice M2 --out test.wav
# with the Vocos second stage (pip install torch vocos):
python speak.py "Hallo, wie geht es dir?" --voice F2 --vocos --out test.wav
```
ONNX inputs: `tokens` and `stress` (int64 [1, N], from `tinyvoca.text.phonemize`), `voice` (int64 [1], index into
`voices`), `speed`, `pitch_shift`, `pitch_range` (float32 [1]; 1.0 / 0.0 / 1.0 for normal). Outputs: `audio`
(float32 [1, samples]) and `durations`. At most 512 phoneme tokens per call; split longer text into sentences.
It is also a voice of [flash-voice](https://github.com/ViktorsGitUser/flash-voice) (`services/tinytts_server.py`,
same HTTP API as the other voices there), as an Apache-2.0 alternative to the German Phonon model, which is
CC BY-NC 4.0 (non-commercial only).
## Training
- **Data:** about 12 hours of synthetic German speech, ~15,000 utterances, made with
[Qwen3-TTS](https://github.com/QwenLM/Qwen3-TTS) 1.7B Base (Apache-2.0) with two of its built-in voices. Texts:
Mozilla Common Voice German sentences (CC0). Utterances were screened with Whisper.
- **Front end:** eSpeak NG `de`, 67 phoneme symbols (the English inventory of tiny-voca replaced by a German one),
German number/date/time normalisation.
- **Model:** tiny-voca recipe, 82k steps on one RTX 3090 (about 10 hours).
- **Vocoder:** Vocos fine-tuned for about 60k steps on an RTX 5060 Ti: input is tiny-voca's own teacher-forced
waveform, target the recording.
- Data, training and tuning took about 12.5 hours on one Sunday.
**Evaluation** (Whisper large-v3-turbo, word error rate): 5.0% on 16 unseen sentences (F2 4.6%, M2 5.5%).
## Limitations
- German only. English words are read with German pronunciation.
- The sound is clear but not studio quality; without Vocos it is noticeably buzzy.
- A word-final long "a" before a comma is sometimes drawn out ("Anna, ...").
- The voices are synthetic (Qwen3-TTS built-in voices), not clones of real people.
## Deutsch
Ein winziges deutsches TTS-Modell für die CPU (4,5M Parameter, 21 MB ONNX), auf Basis von tiny-voca von n4ze3m
nachtrainiert, mit optionalem Vocos-Vocoder. Gewichte und Code unter Apache 2.0, also auch kommerziell nutzbar,
der Vocoder unter MIT. Keine offizielle tiny-voca-Version.
## Credits
- [tiny-voca](https://github.com/n4ze3m/tiny-voca) by n4ze3m: architecture, training recipe, text front end (Apache-2.0)
- [Vocos](https://github.com/gemelo-ai/vocos), `charactr/vocos-mel-24khz` (MIT)
- [Qwen3-TTS](https://github.com/QwenLM/Qwen3-TTS) (Apache-2.0): training speech
- [Mozilla Common Voice](https://commonvoice.mozilla.org) German (CC0): texts
- [eSpeak NG](https://github.com/espeak-ng/espeak-ng) (GPL-3.0, not included), num2words (LGPL-2.1)
|