JyutVoice
Cantonese text-to-speech, with English words inside Cantonese sentences, in the voice of a short reference clip. Code and documentation: https://github.com/hon9kon9ize/JyutVoice. Audio samples: demo page.
JyutVoice predicts the speech features of CosyVoice2's flow decoder directly from text, without CosyVoice2's autoregressive language model. A text encoder, a flow-matching duration sampler and a frame-level prosody sampler (ProsodyCFM; 6.9 M + 2.4 M + 3.6 M parameters, three ONNX graphs) make the features, and CosyVoice2's frozen flow decoder and HiFT vocoder render 24 kHz audio.
Demo
A Cantonese tongue twister read by JyutVoice (27 s):
我叫韓德能,喺呢條黃巷嘅巷口度有一隻狗,佢個名叫做黃汗寒狼。話說喺東方有一個叫做黃汗寒狼牛牙雅夏蝦嘅國家,呢個國家嘅人都好鍾意養狗。佢地係用黃汗寒狼焊汗糠嚟到養嘅。其中以壓乞黑國、很肯國、特突國、能單騰國、華滑挖國、心足縮學咢確國、等登燈等國嘅人最多。
Highlights
- Small and fast: a 13 M-parameter acoustic model takes the place of CosyVoice2's autoregressive language model (112 M parameters for the acoustic model, flow decoder, vocoder and speaker model together).
- Edge model, CPU only: no GPU needed. About 450 MB of model files and 1.5-2 GB of RAM. On a 6-core desktop CPU (AMD Ryzen 5 5500, 6 threads, 10 decoder steps) it is faster than real time for sentences up to about 8 s (real-time factor typically 0.55-0.76) and about real time at 20 s (0.9-1.25).
- Hong Kong accent.
- Code mixing: English words inside Cantonese sentences.
- SSML and Jyutping: typed Jyutping as input, per-word pronunciation fixes (
<phoneme alphabet="jyutping">), rate and volume (<prosody>),<say-as>,<sub>. - Pause control:
<break time="500ms"/>puts a silence of that length where you want it. - ONNX Runtime: the acoustic model, speaker model, flow decoder and vocoder can all run in ONNX Runtime (
--backend onnx).
Research use only. JyutVoice is a research project, and its trained model is released for research purposes only. For any other purpose, including commercial use, please contact joseph.cheng@hon9kon9ize.com.
How it works
From text to tokens
The word boundaries decide how a character is read (太 is taai2 in the word 陳太, taai3 "too" on its own). To see both for your own sentence, with the code from GitHub:
from jyutvoice.text.jyutping_output import jyutping_string, text_readings
from jyutvoice.utils.onnx_infer import prepare_text
words = prepare_text("陳太3點要開meeting。", jyutping=True) # numbers read out, cut into words
print(" | ".join(words.split())) # 陳太 | 三點 | 要 | 開 | meeting | 。
print(jyutping_string(text_readings(words))) # can4 taai2 saam1 dim2 jiu3 hoi1 meeting .
Files and licences
| file | what | licence |
|---|---|---|
onnx_models/text_encoder.onnx, flow_duration_sampler.onnx, prosody_sampler.onnx, manifest.json |
the JyutVoice acoustic model (trained for this project) | research use only, LICENSE |
pretrained_models/flow_decoder.safetensors |
CosyVoice2-0.5B flow decoder (decoder.*, spk_embed_affine_layer.* of its flow.pt), unmodified |
Apache-2.0, LICENSE-APACHE-2.0 |
pretrained_models/hift.safetensors |
CosyVoice2-0.5B HiFT vocoder (hift.pt), unmodified |
Apache-2.0 |
pretrained_models/campplus.onnx |
CAM++ speaker model as distributed with CosyVoice2-0.5B (byte-identical) | Apache-2.0 |
pretrained_models/flow_decoder_estimator.onnx, flow_spk_affine.onnx, hift.onnx |
the flow decoder and vocoder above, exported to ONNX with scripts/export_onnx.py (optional) |
Apache-2.0 |
SHA256SUMS |
checksum of every model file |
The three original CosyVoice2 files come from FunAudioLLM/CosyVoice2-0.5B (campplus.onnx is the same file, sha256 a6ac6a63...; the HiFT
file has the sha256 3386cc88... of its hift.pt; flow.pt is ff4c2f86... and every tensor stored here is equal to the one in it). They are repeated here so that one download
runs the system. Attribution: see NOTICE.
Usage
git clone https://github.com/hon9kon9ize/JyutVoice && cd JyutVoice
pip install -r api/requirements.txt # and the steps in the README (PyTorch, the Cantonese text normaliser)
python scripts/download_models.py # fetches this repository into onnx_models/ and pretrained_models/
python infer.py --text "我喺Zoom開會,但係個microphone有問題。" --ref_audio your_reference.wav --output output.wav
# the flow decoder and vocoder in ONNX Runtime too
python scripts/download_models.py --onnx-decoder
python infer.py --backend onnx --text "今日天氣好好。" --ref_audio your_reference.wav --output output.wav
The repository also has an OpenAI-style HTTP API (CPU or GPU, Docker), SSML and Jyutping input, and a web playground.
Training data
The acoustic model was trained on zoengjyutgaai (CanCLID/zoengjyutgaai, CC0), the MCE Cantonese-English code-mixed recordings (its authors allow research use only and prohibit commercial use without their authorization), the maintainers' own Cantonese corpus (indiejoseph/tts20250516), and sentences from machine transcripts of YouTube and RTHK podcasts, spoken by a teacher model trained on YouTube and RTHK audio. Its training targets are CosyVoice 2 features; the CosyVoice 2 decoder and vocoder were not retrained.
The text front end uses ToJyutping, pycantonese, pydips and WeTextProcessing at run time (not part of this repository's weights).
Limitations
- The reference clip sets pace and delivery as well as timbre (about 10% pace difference between two clips of one voice); a flat clip gives flat speech. There is no emotion or prosody control.
- English words inside Cantonese are recognisable, but their timing and stress are weaker than the Cantonese; the model targets Hong Kong code-mixing, not native English.
- The decoder runs without a speech prompt, so speaker similarity is lower than with a prompted decoder.
- Single-chunk limit of 1,024 tokens; the API splits longer text into chunks of about 100 characters.
- Event sounds (laugh, throat clear) need an event library; none is released.
Citations
JyutVoice:
@misc{jyutvoice2026,
title = {{JyutVoice}: {Cantonese} Text-to-Speech with {English} Code-Mixing},
author = {{hon9kon9ize}},
howpublished = {\url{https://github.com/hon9kon9ize/JyutVoice}},
year = {2026}
}
CosyVoice 2 (flow decoder, vocoder and the features the acoustic model predicts):
@article{du2024cosyvoice2,
title = {{CosyVoice} 2: Scalable Streaming Speech Synthesis with Large Language Models},
author = {Du, Zhihao and Wang, Yuxuan and Chen, Qian and Shi, Xian and Lv, Xiang and Zhao, Tianyu and Gao, Zhifu and Yang, Yexin and Gao, Changfeng and Wang, Hui and Yu, Fan and Liu, Huadai and Sheng, Zhengyan and Gu, Yue and Deng, Chong and Wang, Wen and Zhang, Shiliang and Yan, Zhijie and Zhou, Jingren},
journal = {arXiv preprint arXiv:2412.10117},
year = {2024}
}
MCE (code-mixed Cantonese-English recordings):
@article{xie2023mce,
title = {{MCE}: Mixed Cantonese and English Audio Dataset},
author = {Xie, Peng and Xin, Zihao and Wang, Yang and Huang, Shengjun and Chan, Tsz Wai and Chen, Kani},
journal = {arXiv preprint arXiv:2310.17953v2},
year = {2023}
}
zoengjyutgaai (storytelling recordings, CC0):
@misc{zoengjyutgaai2025,
title = {The {Zoeng Jyut Gaai} Story-telling Speech Dataset},
author = {{Cantonese Computational Linguistics Infrastructure Development Workgroup (CanCLID)}},
howpublished = {\url{https://canclid.github.io/zoengjyutgaai/}},
year = {2025}
}
Intended use and misuse
Research only, for example on Cantonese speech synthesis, accessibility and language tools. For any other purpose, contact joseph.cheng@hon9kon9ize.com. The model clones the voice of a reference clip: use only recordings you may use, and do not use it to impersonate a person, to deceive, or to produce content that harms others. Disclose synthetic speech where people could mistake it for a real recording.

