MeloTTS is a high-quality, open-source text-to-speech system developed by MyShell AI. It is built on top of the VITS/VITS2 architecture and uses BERT-based linguistic features to produce natural-sounding speech. MeloTTS supports multiple languages and is designed to be fast enough for real-time CPU inference.
Strengths of the original MeloTTS:
High naturalness and expressiveness in synthesized speech
Fast inference — runs in real-time even on CPU
Lightweight and easy to deploy
Supports multiple languages (English, Chinese, Japanese, Korean, Spanish, French)
Permissive MIT license, suitable for both commercial and non-commercial use
Limitations of the original MeloTTS:
Not natively optimized for Vietnamese phonology (tones, phonemes)
The default English/multilingual phonemizer does not handle Vietnamese tones and diacritics correctly
No built-in support for Vietnamese-specific linguistic preprocessing
MeloTTS Vietnamese
MeloTTS Vietnamese is a version of MeloTTS specifically optimized for the Vietnamese language. It inherits the high-quality and fast-inference characteristics of the original model while introducing targeted improvements to handle the unique phonological properties of Vietnamese — including its 6 tones, complex vowel system, and syllable structure.
This model is designed to produce natural, accurate Vietnamese speech and can be easily fine-tuned on custom Vietnamese datasets.
The model was trained on the Infore dataset, consisting of approximately 25 hours of speech
Note on data quality: This dataset has several limitations including suboptimal voice quality, missing punctuation, and imprecise phonetic transcriptions. However, when trained on internal/private high-quality data, results are significantly better.
Downloading the Model
The pre-trained model can be downloaded from Hugging Face:
Download the model checkpoint and config from Hugging Face and place them in your desired directory.
3. Run Inference
Refer to the notebook test_infer.ipynb for a full example. Basic usage:
python
1from melo.api import TTS
23# Speed is adjustable4speed =1.056# You can set device to 'cpu', 'cuda', 'cuda:0', or 'mps'7device ="cuda:0"# Will automatically use GPU if available89# Load the Vietnamese TTS model10model = TTS(11 language="VI",12 device=device,13 config_path="/path/to/config.json",14 ckpt_path="/path/to/G_model.pth",15)16speaker_ids = model.hps.data.spk2id
1718# Convert text to speech19text ="Nhập văn bản tại đây"20output_path ="output.wav"21model.tts_to_file(text, speaker_ids["speaker_name"], output_path, speed=speed, quiet=True)
Part 2: Training & Fine-tuning
1. Data Preparation
The full data preparation process is detailed in docs/training.md. At minimum, you need:
"Buổi sáng ở thành phố bắt đầu bằng tiếng xe cộ nhộn nhịp và ánh nắng nhẹ xuyên qua những tòa nhà cao tầng."
Sample 2
"Người đi làm vội vã, học sinh ríu rít trò chuyện, còn quán cà phê góc phố thì thoang thoảng mùi thơm dễ chịu."
Sample 3
"Cuối cùng, hãy thử thì thầm một câu thật nhẹ nhàng, rồi bất ngờ chuyển sang giọng nói to, rõ và đầy năng lượng."
License
This project is licensed under the MIT License, consistent with the original MeloTTS project. It may be used for both commercial and non-commercial purposes.
Acknowledgements
This implementation is based on TTS, VITS, VITS2, and Bert-VITS2. We appreciate their outstanding work.