Vietnamese Text-to-Speech and Speech-to-Text library with embedded models
Project description
VNTTS
Dự án tích hợp Vietnamese Text-to-Speech (TTS) và Speech-to-Text (STT):
- TTS:
nghitts/ Piper-compatible ONNX (giọng Banmai) - STT:
sherpa-onnx-zipformer-vi-2025-04-20
Cấu trúc dự án
VNTTS/
src/vntts/
__init__.py
tts.py
stt.py
model_downloader.py # Downloads models from GitHub Releases
model_parts.py # Helpers for split/merge model files
scripts/
split_model.py
merge_model.py
tests/
README.md
Cài đặt
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Model Loading
Models are automatically downloaded from GitHub Releases on first use.
When TTS() or STT() is instantiated without an explicit model_dir,
the library:
- Checks if the models directory exists (default:
./models) - If not, downloads
models.zipfrom the configured GitHub Release URL - Extracts the zip and removes the archive
- Subsequent runs skip the download (idempotent)
Environment Variables
| Variable | Description | Default |
|---|---|---|
VNTTS_MODELS_DIR |
Root directory for models | models |
VNTTS_MODELS_URL |
URL for models.zip |
(GitHub Release) |
VNTTS_MODEL_DOWNLOAD_TIMEOUT_SECONDS |
Network timeout | 120 |
VNTTS_MODEL_DOWNLOAD_RETRIES |
Retry attempts | 3 |
VNTTS_MODEL_DOWNLOAD_LOG |
Set 0 to disable logs |
1 |
Explicit Model Directory
You can also provide your own model directory:
from vntts import TTS, STT
tts = TTS(model_dir="/path/to/tts/models")
stt = STT(model_dir="/path/to/stt/models")
Testing
pytest
Building
python -m build
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vntts-0.1.5.tar.gz.
File metadata
- Download URL: vntts-0.1.5.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
056be082bd3b3699b0dadc132736f88fd3a439824f7267dee69391b3b8030ea4
|
|
| MD5 |
b71196375bff1008459cd8c6eff08790
|
|
| BLAKE2b-256 |
30c39876bacd3daf0949c7dedaf84d073f5809bf51bf0fc5917d27c9d36ffb0c
|
File details
Details for the file vntts-0.1.5-py3-none-any.whl.
File metadata
- Download URL: vntts-0.1.5-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc708984a063c90bbadb261e2dc1c0576251d46e0781f3c2978998da9ab96459
|
|
| MD5 |
b24e9ed8b6ce1f7660e603007f17534c
|
|
| BLAKE2b-256 |
4464b3caaadf573f43889f984764adbcf125f898ebfb65418917325773eb56f9
|