Skip to main content

ninada

Stream 24,000 Hz studio speech for Classical Sanskrit and five Indian languages (sa, kn, hi, ta, te, ml) in the browser, Node.js, and Python using 27.9 MB native per-language VITS ONNX specialists (Male & Female) with zero cross-language accent bleed.

npm install ninada webml-kit
pip install ninada

Quick start

import ninada from 'ninada';
import { detectDevice } from 'webml-kit';

const { backend } = await detectDevice();
const voice = await ninada('gnumanth/ninada', {
  lang: 'kn',
  voice: 'male',
  device: backend,
});

for await (const chunk of voice.stream('ನಮಸ್ಕಾರ, ಇಂದು ಬೆಂಗಳೂರಿನಲ್ಲಿ ಹವಾಮಾನ ತುಂಬಾ ಚೆನ್ನಾಗಿದೆ.')) {
  playPcm24k(chunk.pcm, chunk.sampleRate); // Float32Array @ 24,000 Hz
}

const wav = await voice.speak('ಕನ್ನಡವೇ ಸತ್ಯ ಕನ್ನಡವೇ ನಿತ್ಯ', { lang: 'kn', voice: 'female' });
await voice.dispose();

voice.stream() yields 24,000 Hz PCM clauses as they synthesize with 0 AudioWorklet underruns and CacheStorage + IndexedDB persistence (0 refetches on reload). voice.speak() returns a complete 24 kHz RIFF WAV buffer.

Python

from ninada import Ninada

tts = Ninada(lang="sa")
for chunk in tts.stream("प्रज्ञापूर्वकव्यापारवत्त्वं जीवत्वम् । यथार्थज्ञानं प्रमाणम् ॥"):
    play(chunk["pcm"], chunk["sample_rate"])  # float32 @ 24,000 Hz (~0.197x CPU RTF)

wav_bytes = tts.speak("सत्यमेव जयते नानृतम्", lang="sa", voice="female")
open("satyam.wav", "wb").write(wav_bytes)

Ninada loads dedicated 27.9 MB W8A32+FP16 ONNX specialists (onnx/{sa,kn,hi,ta,te,ml}.onnx and onnx/{sa,kn,hi,ta,te,ml}_female.onnx), each trained exclusively on its own language's ai4bharat/Rasa single-speaker 24 kHz studio recordings and native Unicode orthography.

CLI

npx ninada "ಕನ್ನಡವೇ ಸತ್ಯ ಕನ್ನಡವೇ ನಿತ್ಯ" -l kn -o kannada.wav
ninada "सत्यमेव जयते नानृतम्" -l sa -o satyam.wav

Runs 24 kHz neural synthesis when ONNX weights are available and falls back automatically to a 0.0 MB zero-dependency Cascade Klatt-Akṣara synthesizer offline.

Native Script Orthography & Prosody

import { studioTextToIds, textToIds } from 'ninada';

const { studioIds, lang } = studioTextToIds('ವಾಙ್ಮಯ ತಪಸ್ಸು ಮತ್ತು ಜ್ಞಾನ ವಿಕಾಸ ಅತ್ಯಂತ ಮುಖ್ಯವಾದವು.', 'kn');
const { aksharas } = textToIds('धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः ।', 'sa');

studioTextToIds() tokenizes directly in each language's native Unicode character table (sa 144 tokens, kn 85, hi 120, ta 61, te 110, ml 101) — preserving Classical Sanskrit vocalic ṛ/ṝ/ḷ, visarga sandhi, Kannada ಙ/ಃ allophony, Tamil ழ/ற/ன, and Malayalam atomic chillus (ൺ ൻ ർ ൽ ൾ ൿ) feeding a 24 kHz RelativePositionTransformer + StochasticDurationPredictor + HiFi-GAN v1 studio generator.

Benchmarks (N = 240 Held-Out 24 kHz Studio Utterances, B = 1,000 Bootstrap 95% CIs)

System Rate Footprint (↓) Coverage (↑) TTFA p50 (↓) MCD 0–8 kHz (dB, ↓) 8–12 kHz HF Err (dB, ↓) Dur MAE (↓)
Base facebook/mms-tts-hin 16 kHz 138.8 MB 35.0% 1.0 ms* 7.97 [7.69, 8.24] 66.24 dB 3.21s
Meta MMS 5-Specialist Fleet (5x VITS) 16 kHz 694.0 MB 100.0% 60.2 ms 5.09 [5.03, 5.15] 65.90 dB 1.34s
ninada v4.0 Untuned Warm-Start (step=0) 24 kHz 112.0 MB 100.0% 189.2 ms 4.60 [4.54, 4.65] 11.01 dB 0.95s
ninada v4.0 Native Studio FP32 24 kHz 112.0 MB 100.0% 45.3 ms 3.40 [3.37, 3.43] 6.34 dB 0.57s
ninada v4.0 Native Browser ONNX 24 kHz 27.9 MB 100.0% 372.7 ms 3.39 [3.36, 3.43] 6.37 dB 0.56s
ninada Tier-2 Klatt Fallback 24 kHz 0.0 MB 100.0% 104.0 ms 10.38 [10.26, 10.50] 41.94 dB 0.98s

Per-language held-out MCD 0–8 kHz (dB, ↓): Sanskrit 3.51 (vs 5.32 MMS), Hindi 3.37 (vs 4.85 MMS), Kannada 3.35 (vs 5.04 MMS), Tamil 3.21 (vs 4.87 MMS), Telugu 3.59 (vs 5.57 MMS), Malayalam 3.34 (vs 4.88 MMS). Full bootstrap CIs and parity telemetry (0.61 dB parity MCD, r = 0.9999) in bench/SCIENCE_REPORT.md and bench/results.json.

Reproduce & Verify

PYTHONPATH=python/src:. python training/train_native_specialists_gcp.py --work-dir data/v4 --out-dir artifacts/ninada_v4
PYTHONPATH=python/src:. python bench/check_bench_thresholds.py
pytest -q && node verify-browser.mjs

Trains all 12 native 24 kHz Male/Female studio VITS specialists, evaluates 240 held-out studio clips, and verifies 0 AudioWorklet underruns and 0 cached network refetches in headless Chromium.

License

MIT © Hemanth.HM

Metadata

Release files for ninada 4.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ninada 4.0.1
File Size Uploaded Provenance Actions
ninada-4.0.1.tar.gz 50.2 kB Without provenance Details for ninada-4.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ninada 4.0.1
File Interpreter ABI Platform Actions
ninada-4.0.1-py3-none-any.whl Python 3 none any Details for ninada-4.0.1-py3-none-any.whl

Total release size: 88.3 kB

Release files / ninada-4.0.1.tar.gz

Download URL ninada-4.0.1.tar.gz
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
05b0ac9965d27d94582854d080db6344e016b769401f40066e649347af9f36a6
BLAKE2b-256 checksum
How to use checksums
bcb9ce734c6f9d57df6069992c5bc0125143e88bde9a9974293daa54677fd719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ninada-4.0.1-py3-none-any.whl

Download URL ninada-4.0.1-py3-none-any.whl
Size 38.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c59ee73f5285723cd77392337af4c0b92022995f358b3610fb7ec65e353c3737
BLAKE2b-256 checksum
How to use checksums
7e63af40cdc604398dd7731636d45ac96b935a24b9c2d28aec34ec3cfa02388b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for ninada 4.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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