Metadata-Version: 2.4
Name: donglao-tts
Version: 0.1.5
Summary: AR+NAR neural TTS (RVQ audio-codec based) with a MOSS codec front-end
Project-URL: Homepage, https://github.com/DongLaoAI/donglao-tts
Project-URL: Repository, https://github.com/DongLaoAI/donglao-tts.git
Project-URL: Issues, https://github.com/DongLaoAI/donglao-tts/issues
Project-URL: Models, https://huggingface.co/DongLao/DongLao-TTS
Author: donglao-tts maintainers
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: pytorch,rvq,speech-synthesis,tts,vietnamese
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: <3.11,>=3.10
Requires-Dist: donglao-g2p<0.4,>=0.3
Requires-Dist: huggingface-hub<2,>=1
Requires-Dist: numpy<3,>=1.26
Requires-Dist: pyyaml<7,>=6
Requires-Dist: safetensors<1,>=0.8
Requires-Dist: sentencepiece<0.3,>=0.2
Requires-Dist: soundfile<1,>=0.13
Requires-Dist: torch<3,>=2.8.0
Requires-Dist: torchaudio<3,>=2.8.0
Requires-Dist: transformers<5.14,>=5.13
Provides-Extra: export
Requires-Dist: onnx<2,>=1.22; extra == 'export'
Requires-Dist: onnxruntime<1.24,>=1.23; extra == 'export'
Provides-Extra: gguf
Requires-Dist: gguf<0.20,>=0.19; extra == 'gguf'
Provides-Extra: openvino
Requires-Dist: openvino<2027,>=2026.2; extra == 'openvino'
Description-Content-Type: text/markdown

<div align="center">
  <img src="https://raw.githubusercontent.com/DongLaoAI/donglao-tts/main/assets/donglao-tts-logo.png" alt="donglao-tts — angular horizontal singing crocodile logo" width="720" />

  <h1>donglao-tts</h1>

  <p><strong>Reference-voice text-to-speech with a simple Python API.</strong></p>
</div>

> Research/pre-1.0 release. APIs may change between versions. Use reference voices only with the
> speaker's permission.

## Recommended Python API

```bash
uv add donglao-tts

# Or with pip
python -m pip install donglao-tts
```

```python
from donglao_tts import DongLaoTTS

tts = DongLaoTTS.from_pretrained("DongLao/DongLao-TTS")

waveform = tts.generate(
    "Xin chào mọi người, đây là Đông Lào TTS.",
    reference_audio="reference.wav",
    reference_text="Exact transcript of the speech in reference.wav.",
    output_path="output.wav",
)

print(tts.revision)
print(tts.sample_rate)
print(tuple(waveform.shape))
```

The first call downloads the model, tokenizer, and bundled MOSS codec. CUDA is selected when
available; otherwise the model runs on CPU. Reuse the loaded `tts` object for subsequent calls.

For reproducible use, pin a tested model commit:

```python
tts = DongLaoTTS.from_pretrained(
    "DongLao/DongLao-TTS",
    revision="6ba3003ccb8d938c2a725a4117084492909c9419",
    device="cuda",
)
```

Generation controls are available when needed:

```python
waveform = tts.generate(
    "Text to synthesize.",
    reference_audio="reference.wav",
    reference_text="Exact reference transcript.",
    output_path="output.wav",  # optional
    max_frames=200,
    temperature=1.0,
    top_k=0,
)
```

The returned waveform is a CPU PyTorch tensor with shape `[channels, samples]`.

## Runtime requirements

- Python `>=3.10,<3.11`
- Linux x86-64
- PyTorch and TorchAudio `>=2.8.0,<3`
- CUDA-capable GPU recommended; CPU inference is supported

## Reference audio

Use a clean, consented recording containing one speaker. `reference_text` must match the spoken
content exactly. Avoid music, overlapping speakers, clipping, long silence, and heavy reverb.

## Verify the installation

```bash
donglao-smoke-test-hub \
  --repo-id DongLao/DongLao-TTS \
  --device cpu
```

For an end-to-end test, also pass `--ref-audio`, `--ref-text`, `--target-text`, and `--output`.

## Responsible use

Obtain consent before using a voice, disclose synthetic audio when appropriate, and protect
reference recordings and transcripts. Do not use the package for impersonation, fraud,
harassment, or bypassing voice authentication.

## Links

- [Source and full documentation](https://github.com/DongLaoAI/donglao-tts)
- [Published model](https://huggingface.co/DongLao/DongLao-TTS)
- [Issue tracker](https://github.com/DongLaoAI/donglao-tts/issues)
- [Apache License 2.0](https://github.com/DongLaoAI/donglao-tts/blob/main/LICENSE)
