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.7.tar.gz (419.3 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.7-py3-none-any.whl (82.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: donglao_tts-0.1.7.tar.gz
  • Upload date:
  • Size: 419.3 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.7.tar.gz
Algorithm Hash digest
SHA256 9c76683435a7e5c2aeedfc48135a44f93271fe93e001cd652e2a437626a37335
MD5 339e429472961545514b32826d95297b
BLAKE2b-256 f1dd5e5eb4e377d471d02f1909a933007187ccf5a80cb8b367f6b4767f6f3274

See more details on using hashes here.

Provenance

The following attestation bundles were made for donglao_tts-0.1.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: donglao_tts-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 82.3 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 eac771d1f428dbadfcddfaba3d3cce44df9065839c1a26a65fc4b7d05501e876
MD5 b5aca0b05cd296b39a056c3979a71fdf
BLAKE2b-256 81de63eb152a9fc4f133f59263fdfeb6fac988c86ebfdd7b66b79555baad9d4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for donglao_tts-0.1.7-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

This release

0.1.7 This release

2 files

0.1.6

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