Piper-format Thai voices (converted from MMS-TTS)
Two Thai TTS voices packaged in Piper format (.onnx + .onnx.json), so they
load directly with piper-tts — no separate inference engine needed.
Piper has no official Thai voice: rhasspy/piper-voices has no th/ directory.
These are format conversions of existing MMS-TTS Thai fine-tunes.
| File | Source model | Sample rate |
|---|---|---|
th_TH-mms_female-medium.onnx | VIZINTZOR/MMS-TTS-THAI-FEMALEV2 | 22.05 kHz |
th_TH-mms_male-medium.onnx | VIZINTZOR/MMS-TTS-THAI-MALEV1 | 22.05 kHz |
Both source repos have 16 kHz siblings (FEMALEV1, MALEV2, MALE-NARRATOR);
the two above were picked because they are 22.05 kHz, matching Piper's own voices.
Usage
import wave
from piper.voice import PiperVoice
voice = PiperVoice.load("th_TH-mms_female-medium.onnx")
with wave.open("out.wav", "wb") as f:
voice.synthesize_wav("สวัสดีครับ นี่คือเสียงตัวอย่าง", f)
How the conversion works
MMS-TTS and Piper are both VITS, so only the ONNX graph signature and the text representation differ.
- The model is re-exported with Piper's input signature —
input,input_lengths,scales— wrappingtransformers'VitsModel. - The config uses
"phoneme_type": "text", where Piper treats each Unicode codepoint as a phoneme. That matches MMS exactly: a 71-character Thai vocabulary, no phonemization, no espeak-ng. - Piper emits the id sequence
BOS, PAD, c1, PAD, …, cN, PAD, EOS, while MMS was trained onintersperse(seq, 0)—0, c1, 0, …, cN, 0. MappingBOSandEOSto empty lists inphoneme_id_mapmakes the two line up exactly.PADmaps to[0], MMS's blank token.
Known limitation
The MMS vocabulary only contains the digits 0, 1, 2 and 4. Any other
digit is dropped as an unknown character. Spell numbers out as words before
synthesis.
Credits and license
cc-by-nc-4.0, inherited from facebook/mms-tts
(the base model these fine-tunes derive from). Non-commercial use only.
- Base model — Meta AI, MMS-TTS (CC-BY-NC-4.0)
- Thai fine-tunes — VIZINTZOR
- Piper — OHF-Voice/piper1-gpl