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.2-py3-none-any.whl (897.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kala_tts-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 897.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1da0c10f82b31ea96bbb2a91f6fb3e2827fe9fac9546d1b6bf9dd270cba9ea03
MD5 a83ac95c05be7cd8e9a7ddf178b2643b
BLAKE2b-256 c97864abdf856611109b3555045795ffcc56e1adc004c45dc515650a1bcc15de

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