Skip to main content

CPU-native Nepali TTS — real_nepali G2P + VITS ONNX inference

Project description

kala-tts

CPU-native Nepali text-to-speech. The first open-source Nepali TTS built without eSpeak.

pip install kala-tts
import kala_tts

kala_tts.synthesize_to_file("नमस्कार, कसरी हुनुहुन्छ?", "out.wav")

What makes it different

eSpeak-ng maps Nepali affricates to alveolar labels (ts, tsh) that do not match how Kathmandu speakers actually produce and . kala-tts uses the real_nepali G2P — built from Khatiwada (2009) and a 48 000-entry curated lexicon — which outputs palatal ch/chh as the acoustic target.

Feature eSpeak ne kala-tts
च / छ ts / tsh (alveolar) ch / chh (palatal)
Gemination often lost explicit ː tokens
Schwa deletion heuristic rule-based, audited
Latin code-switch undefined letter-by-letter + lexicon
Lexicon none 48 000 entries

API

import kala_tts

# Returns WAV bytes (16-bit PCM mono, 22050 Hz)
wav: bytes = kala_tts.synthesize("नेपाल सुन्दर देश हो।", speaker="kala")

# Write directly to file
kala_tts.synthesize_to_file("नमस्कार", "output.wav", speaker="barsha")

# Speed control
wav = kala_tts.synthesize("राम्रो दिन!", speed=0.85)  # slower

# List speakers
print(kala_tts.list_speakers())
# ('kala', 'barsha', 'slr143_F', 'slr43_0546', 'slr43_2099')

CLI

kala-tts "नमस्कार, कसरी हुनुहुन्छ?" --speaker kala -o out.wav
kala-tts --list-speakers
echo "नेपाल सुन्दर देश हो।" | kala-tts -o out.wav

Speakers

Name Data Notes
kala human studio recommended
barsha human recording most data
slr143_F OpenSLR-143 neutral prosody
slr43_0546 OpenSLR-43 read speech
slr43_2099 OpenSLR-43 read speech

Model

The first call auto-downloads the ONNX model (~60 MB) from ampixa/real-nepali-v0.2-kala via huggingface_hub and caches it locally. No internet needed after first run. No GPU required.

  • Architecture: VITS (ONNX FP32)
  • Sample rate: 22050 Hz
  • CPU RTF: ~0.020 (50× real-time on a laptop)

License

MIT (code) — CC-BY-SA 4.0 (model weights and training data). See LICENSES.md for full attribution.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

kala_tts-0.1.4-py3-none-any.whl (897.0 kB view details)

Uploaded Python 3

File details

Details for the file kala_tts-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: kala_tts-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 897.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for kala_tts-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e3940d177d5164a4ec2ba09427cfe1dcf19bcdf51e74bbf57311d1463681dfad
MD5 cee71dea02bac6fefaa8ca0d34c960ac
BLAKE2b-256 9f5288cc28e2ffae8cb0e5c89fcc5ca6c5f3727492c934bc09cb0727110c7344

See more details on using hashes here.

Supported by

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