Views
No views yet

[!TIP] Voice Cloning: All model variants (including GGUF) support instant voice cloning with just 3-5 seconds of reference audio.
Trên bầu trời xanh thẳm, những đám mây trắng lửng lờ trôi như những chiếc thuyền nhỏ đang lướt nhẹ theo dòng gió. Dưới mặt đất, cánh đồng lúa vàng rực trải dài tới tận chân trời, những bông lúa nghiêng mình theo từng làn gió.
.msi from eSpeak NG Releases.brew install espeaksudo apt install espeak-ng1git clone https://github.com/pnnbao97/VieNeu-TTS.git
2cd VieNeu-TTS
3
4# Install uv (if you haven't)
5# Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
6# Linux/macOS: curl -LsSf https://astral.sh/uv/install.sh | sh
7
8# Install dependencies & Run
9uv sync
10uv run gradio_app.py1# Windows (Avoid llama-cpp build errors)
2pip install vieneu --extra-index-url https://pnnbao97.github.io/llama-cpp-python-v0.3.16/cpu/
3
4# Linux / MacOS
5pip install vieneu1from vieneu import Vieneu
2import os
3
4# Initialization
5tts = Vieneu() # Default: 0.3B-Q4 GGUF for CPU
6os.makedirs("outputs", exist_ok=True)
7
8# 1. List preset voices
9available_voices = tts.list_preset_voices()
10for desc, name in available_voices:
11 print(f" - {desc} (ID: {name})")
12
13# 2. Use specific voice (dynamically select second voice)
14if available_voices:
15 _, my_voice_id = available_voices[1] if len(available_voices) > 1 else available_voices[0]
16 voice_data = tts.get_preset_voice(my_voice_id)
17 audio_spec = tts.infer(text="Chào bạn, tôi đang nói bằng giọng của bác sĩ Tuyên.", voice=voice_data)
18 tts.save(audio_spec, f"outputs/standard_{my_voice_id}.wav")
19 print(f"💾 Saved synthesis to: outputs/standard_{my_voice_id}.wav")
20
21# 3. Standard synthesis (uses default voice)
22text = "Xin chào, tôi là VieNeu. Tôi có thể giúp bạn đọc sách, làm chatbot thời gian thực, hoặc thậm chí clone giọng nói của bạn."
23audio = tts.infer(text=text)
24tts.save(audio, "outputs/standard_output.wav")
25print("💾 Saved synthesis to: outputs/standard_output.wav")
26
27# 4. Zero-shot voice cloning
28if os.path.exists("examples/audio_ref/example_ngoc_huyen.wav"):
29 cloned_audio = tts.infer(
30 text="Đây là giọng nói đã được clone thành công từ file mẫu.",
31 ref_audio="examples/audio_ref/example_ngoc_huyen.wav",
32 ref_text="Tác phẩm dự thi bảo đảm tính khoa học, tính đảng, tính chiến đấu, tính định hướng."
33 )
34 tts.save(cloned_audio, "outputs/standard_cloned_output.wav")
35 print("💾 Saved cloned voice to: outputs/standard_cloned_output.wav")
36
37# 5. Cleanup
38tts.close()docker run --gpus all -p 23333:23333 pnnbao/vieneu-tts:serve --model pnnbao-ump/VieNeu-TTS --tunnel1from vieneu import Vieneu
2import os
3
4# Configuration
5REMOTE_API_BASE = 'http://your-server-ip:23333/v1' # Or bore.pub:XXXX
6REMOTE_MODEL_ID = "pnnbao-ump/VieNeu-TTS"
7
8# Initialization (LIGHTWEIGHT - only loads small codec locally)
9tts = Vieneu(mode='remote', api_base=REMOTE_API_BASE, model_name=REMOTE_MODEL_ID)
10os.makedirs("outputs", exist_ok=True)
11
12# List remote voices
13available_voices = tts.list_preset_voices()
14for desc, name in available_voices:
15 print(f" - {desc} (ID: {name})")
16
17# Use specific voice
18if available_voices:
19 _, my_voice_id = available_voices[1]
20 voice_data = tts.get_preset_voice(my_voice_id)
21 audio_spec = tts.infer(text="Chào bạn, tôi đang nói bằng giọng của bác sĩ Tuyên.", voice=voice_data)
22 tts.save(audio_spec, f"outputs/remote_{my_voice_id}.wav")
23 print(f"💾 Saved synthesis to: outputs/remote_{my_voice_id}.wav")
24
25# Standard synthesis
26text_input = "Chế độ remote giúp tích hợp VieNeu vào ứng dụng Web hoặc App cực nhanh mà không cần GPU tại máy khách."
27audio = tts.infer(text=text_input)
28tts.save(audio, "outputs/remote_output.wav")
29print("💾 Saved remote synthesis to: outputs/remote_output.wav")
30
31# Zero-shot voice cloning (encodes audio locally, sends codes to server)
32if os.path.exists("examples/audio_ref/example_ngoc_huyen.wav"):
33 cloned_audio = tts.infer(
34 text="Đây là giọng nói được clone và xử lý thông qua VieNeu Server.",
35 ref_audio="examples/audio_ref/example_ngoc_huyen.wav",
36 ref_text="Tác phẩm dự thi bảo đảm tính khoa học, tính đảng, tính chiến đấu, tính định hướng."
37 )
38 tts.save(cloned_audio, "outputs/remote_cloned_output.wav")
39 print("💾 Saved remote cloned voice to: outputs/remote_cloned_output.wav")| File | Gender | Accent | Description |
|---|---|---|---|
| Bình | Male | North | Male voice, North accent |
| Tuyên | Male | North | Male voice, North accent |
| Nguyên | Male | South | Male voice, South accent |
| Hương | Female | North | Female voice, North accent |
| Ngọc | Female | North | Female voice, North accent |
| Đoan | Female | South | Female voice, South accent |
| Model | Format | Device | Quality | Speed |
|---|---|---|---|---|
| VieNeu-TTS | PyTorch | GPU/CPU | ⭐⭐⭐⭐⭐ | Very Fast with lmdeploy |
| VieNeu-TTS-0.3B | PyTorch | GPU/CPU | ⭐⭐⭐⭐ | Ultra Fast (2x) |
| VieNeu-TTS-0.3B-q4-gguf | GGUF Q4 | CPU/GPU | ⭐⭐⭐ | Extreme Speed (2x) |
1@misc{vieneutts2026,
2 title = {VieNeu-TTS: Vietnamese Text-to-Speech with Instant Voice Cloning},
3 author = {Pham Nguyen Ngoc Bao},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/pnnbao-ump/VieNeu-TTS}}
7}1@misc{neuttsair2026,
2 title = {NeuTTS Air: On-Device Speech Language Model with Instant Voice Cloning},
3 author = {Neuphonic},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/neuphonic/neutts-air}}
7}