Skip to main content

🦜 VieNeu-TTS

VieNeu-TTS is an advanced on-device Vietnamese Text-to-Speech (TTS) with instant voice cloning and English–Vietnamese bilingual support. The SDK defaults to VieNeu-TTS v3 Turbo (48 kHz) and the minimal install is torch-free — on CPU it runs entirely on ONNX Runtime.

Hugging Face v3 Turbo License

✨ Key Features

  • v3 Turbo, 48 kHz — high-fidelity, natural Vietnamese speech (default).
  • Torch-free on CPU — minimal install runs on ONNX Runtime; PyTorch is never imported.
  • int8 backbone by default on CPU — ~1.6× faster & ~4× smaller than fp32, quality preserved. Use Vieneu(precision="fp32") for max fidelity.
  • Built-in default voices — call them by name, no reference clip needed.
  • Instant voice cloning — clone any voice from 3–5s of audio.
  • Emotion cues (experimental) — drop [cười], [thở dài], [hắng giọng] into the text.
  • Bilingual (En–Vi) code-switching, fully offline.

📦 Install

CPU (default) — torch-free, runs v3 Turbo via ONNX Runtime. Most users want this:

pip install vieneu

GPU (CUDA) — only if you have an NVIDIA GPU. Install a CUDA build of PyTorch yourself first. Batching then turns on automatically on CUDA — same API, no code change:

pip install torch==2.8.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu128
pip install "transformers>=4.51"   # Qwen3 backbone + MOSS codec
pip install vieneu

ℹ️ When is GPU actually worth it? The GPU win comes from batching, so it only pays off on long text (many chunks generated together in one forward — long-form or bulk synthesis). For short text the torch-free CPU/ONNX path is usually faster (there's no batch to fill). Use CPU for short, interactive calls; reach for GPU for long-form or high-throughput work.


🚀 Quick Start (Python SDK)

from vieneu import Vieneu

# Default = v3 Turbo (48 kHz). GPU → PyTorch (auto-detected).
# On CPU the backbone runs int8 by default (fastest); pass precision="fp32" for max quality.
tts = Vieneu()                    # int8 backbone (default, fastest on CPU)
# tts = Vieneu(precision="fp32")  # fp32 backbone (max quality, slower on CPU)

# 1. Built-in voice by name — no reference needed
print("🔊 Generating speech...")
audio = tts.infer("Xin chào, đây là VieNeu-TTS.", voice="Trúc Ly")
tts.save(audio, "output.wav")
print("✅ Saved to output.wav")

# List the built-in voices
voices = tts.list_preset_voices()
print(f"\n🎙️  {len(voices)} built-in voices available:")
for label, voice_id in voices:
    print(f"  - {label} ({voice_id})")

# 2. Reading style: "tu_nhien" (natural) | "tin_tuc" (news) | "doc_truyen" (storytelling)
audio = tts.infer("Bản tin sáng nay.", voice="Phạm Tuyên", style="tin_tuc")

# 3. Emotion / non-verbal cues — EXPERIMENTAL: [cười] [thở dài] [hắng giọng]
audio = tts.infer("Nghe hay quá đi [cười].", voice="Trúc Ly")

# 4. ⚡ Batch on GPU: infer_batch() runs many texts in ONE batched forward — same API.
#    On a CUDA GPU the chunks from every text share each forward step (big throughput
#    win); on CPU it still works (no error), just sequentially. Batch caps at
#    max_batch_size (default 32; or infer_batch(..., batch_size=64); batch_size=1
#    disables). A single long infer() also auto-batches its own chunks. Uncomment to try:
#
# import time
# texts = [
#     "Chào cả nhà, hôm nay mình sẽ hướng dẫn các bạn cách cài đặt và sử dụng bộ giọng đọc mới.",
#     "Giọng nghe cực kỳ tự nhiên và truyền cảm, lại có thể chuyển đổi biểu cảm một cách linh hoạt.",
#     "Nếu thấy hữu ích, các bạn nhớ để lại một lượt thích và chia sẻ video này cho mọi người nhé!",
# ] * 10   # 30 texts — enough to fill the batch and really show the GPU throughput win
# t0 = time.time()
# audios = tts.infer_batch(texts, voice="Phạm Tuyên")
# elapsed = time.time() - t0
# total_audio = sum(len(a) for a in audios) / 48_000
# print(f"⚡ {len(texts)} texts | audio {total_audio:.1f}s | wall {elapsed:.1f}s | RTF {elapsed/total_audio:.3f}")
# for i, a in enumerate(audios):
#     tts.save(a, f"batch_{i}.wav")

🔊 Real-time streaming

v3 Turbo streams frame-by-frame (first audio ~300 ms, RTF < 1 on CPU) — iterate infer_stream:

for chunk in tts.infer_stream("Xin chào các bạn!", voice="Trúc Ly"):
    play(chunk)   # np.float32 @ 48 kHz, play/write as it arrives

A full FastAPI web demo is in apps/web_stream.py (uv run python -m apps.web_stream → http://localhost:8001).

🦜 Zero-shot Voice Cloning

Clone from a short clip; the reference is auto-denoised and trimmed to ≤ 8s.

from vieneu import Vieneu
tts = Vieneu()

# Clone straight from a 3–8s clip
audio = tts.infer("Chào bạn, đây là giọng của tôi.", ref_audio="path/to/voice.wav", denoise=True)
tts.save(audio, "cloned.wav")

# Save a cloned voice and reuse it by name
tts.add_voice("Giọng của tôi", "path/to/voice.wav")
audio = tts.infer("Câu này dùng giọng đã lưu.", voice="Giọng của tôi")

# Just clean up a clip (no synthesis)
wav, sr = tts.denoise("noisy.wav", out_path="clean.wav")

denoise, add_voice, and cloning require the PyTorch (GPU) engine; built-in voices work everywhere.


🔬 Model Overview

Model Engine Device Sample Rate Features
VieNeu-TTS v3 Turbo (default) ONNX (CPU) / PyTorch (GPU) CPU/GPU 48 kHz Default voices, cloning, emotion cues

🤝 Support & Links

Made with ❤️ for the Vietnamese TTS community

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vieneu-3.2.3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vieneu-3.2.3-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file vieneu-3.2.3.tar.gz.

File metadata

  • Download URL: vieneu-3.2.3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vieneu-3.2.3.tar.gz
Algorithm Hash digest
SHA256 df538d9510f5d9a6b7a9689d96517f1b8c8158b230bd6a217efcb95a39596b97
MD5 721dddd65608dd0686c667a6c2507d38
BLAKE2b-256 55822acd8b2a5c79601fee256ca2e0fa1749f86d712fb31a534a9e495ea7d72c

See more details on using hashes here.

File details

Details for the file vieneu-3.2.3-py3-none-any.whl.

File metadata

  • Download URL: vieneu-3.2.3-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vieneu-3.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 54fd23bf70dcc5bf83885163de67a0ae2b7d2030cf7b53996d5ec97d2dbb20ca
MD5 827927e58e6e043c0674943ab30dd58f
BLAKE2b-256 351dd5c735824c20e59e2f9e24a5777aa1a37741fa9fca3c46c5d203001c7986

See more details on using hashes here.

Release history Release notifications | RSS feed

3.3.0

2 files

3.2.12

2 files

3.2.11

2 files

3.2.10

2 files

3.2.9

2 files

3.2.8

2 files

3.2.7

2 files

3.2.6

2 files

3.2.5

2 files

3.2.4

2 files

This release

3.2.3 This release

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.4

2 files

3.1.3

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.13

2 files

3.0.12

2 files

3.0.11

2 files

3.0.10

2 files

3.0.9

2 files

3.0.7

2 files

3.0.6

2 files

3.0.5

2 files

3.0.4

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.7.0

2 files

2.6.1

2 files

2.6.0

2 files

2.5.0

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.3.0

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.9

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.7

2 files

1.0.6

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page