Skip to main content
donglao-tts — angular horizontal singing crocodile logo

donglao-tts

Reference-voice text-to-speech with a simple Python API.

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

Recommended Python API

uv add donglao-tts

# Or with pip
python -m pip install donglao-tts
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:

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

Generation controls are available when needed:

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

After G2P conversion, the target is split on periods, synthesized sentence by sentence, and the resulting audio is concatenated in order. The returned waveform is a CPU PyTorch tensor with shape [channels, samples].

Multiple targets sharing the same reference can reuse its preprocessing with generate_batch():

waveforms = tts.generate_batch(
    ["First target.", "Second target."],
    reference_audio="reference.wav",
    reference_text="Exact reference transcript.",
)

generate_stream() yields audio decoded from consecutive RVQ-token groups:

for audio_chunk in tts.generate_stream(
    "First sentence. Second sentence.",
    reference_audio="reference.wav",
    reference_text="Exact reference transcript.",
    chunk_frames=5,
):
    consume(audio_chunk)

The AR KV-cache is preserved between groups. NAR completes the remaining RVQ layers and MOSS decodes each group while AR generation continues. At a 25 Hz codec rate, five frames represent approximately 200 ms of audio.

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

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

Download files

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

Source Distribution

donglao_tts-0.1.6.tar.gz (412.5 kB view details)

Uploaded Source

Built Distribution

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

donglao_tts-0.1.6-py3-none-any.whl (78.4 kB view details)

Uploaded Python 3

File details

Details for the file donglao_tts-0.1.6.tar.gz.

File metadata

  • Download URL: donglao_tts-0.1.6.tar.gz
  • Upload date:
  • Size: 412.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for donglao_tts-0.1.6.tar.gz
Algorithm Hash digest
SHA256 786b2083f3e2fd90abcb895484b95395c34da1520e59123eb0219b3fb8343aa1
MD5 88de3d08383c5908f2de60d0b427b0cc
BLAKE2b-256 3d94c5d4c5674aba71521d930a6cc706c2386ce45fe57b9856b92cadf3a49632

See more details on using hashes here.

Provenance

The following attestation bundles were made for donglao_tts-0.1.6.tar.gz:

Publisher: release.yml on DongLaoAI/donglao-tts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file donglao_tts-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: donglao_tts-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 78.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for donglao_tts-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 56b6c2fba3c91f252a33a7fcf5b0c410786e0caecbbaabf417a9986d17bc1a8c
MD5 ab83ae3fd2fbf2d0f8b25b87d6b997ff
BLAKE2b-256 fa08d7ac2df734408a5226b4add54dd37092f2672f9d6d7955a48d1195af25dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for donglao_tts-0.1.6-py3-none-any.whl:

Publisher: release.yml on DongLaoAI/donglao-tts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.7

2 files

This release

0.1.6 This release

2 files

0.1.5

2 files

0.1.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page