--- language: tr license: mit tags: - piper-tts - text-to-speech - turkish - onnx - quantized thumbnail: null --- # Piper TTS - Turkish (Cem) Single-speaker Turkish TTS model (speaker: **Cem**, 4490 utterances). - **Sample rate:** 24000 Hz - **Phonemes:** 256 (espeak-ng/tr) - **Speakers:** 1 (Cem) - **Architecture:** Piper custom hybrid (resblock=1, upsample_initial_channel=512) - **Inference params:** 21.0M - **Training:** 437 epochs, ~1.77M steps ## Available Models | Variant | Size | Type | |---------|------|------| | [`last.onnx`](last.onnx) | 84.9 MB | FP32 (original) | | [`last.q8.onnx`](last.q8.onnx) | 30.8 MB | INT8 dynamic quantization (recommended for CPU/RPi) | **Q8 (INT8)** gives ~64% size reduction with minimal quality loss. Ideal for Raspberry Pi and CPU inference. ## Sample Audio Cem voice reading a Turkish finance/economy paragraph (~24s, 410 chars): Epoch 426:
Epoch 450~ Inference CPU - intel 14600K - 0.4 avg_rtf ## Usage ```bash # With piper CLI echo "Merhaba dünya" | piper --model last.q8.onnx --output-raw | aplay -r 24000 -f S16_LE -t raw ``` ```python import onnxruntime as ort import numpy as np session = ort.InferenceSession("last.q8.onnx") dummy = { "input": np.random.randint(0, 100, (1, 50), dtype=np.int64), "input_lengths": np.array([50], dtype=np.int64), "scales": np.array([0.667, 1.0, 0.8], dtype=np.float32), } audio = session.run(["output"], dummy)[0] ``` Or with [piper-phonemize](https://github.com/rhasspy/piper-phonemize) + [piper-tts](https://github.com/rhasspy/piper).