Skip to main content

ninada

Stream 24,000 Hz studio speech for Indian English, Classical Sanskrit, and ten Indian languages (sa, en, hi, kn, mr, bn, ta, te, ml, gu, pa, or) in the browser, Node.js, and Python using 27.9 MB native per-language VITS ONNX specialists (24 Male & Female studio models) 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,en,hi,kn,mr,bn,ta,te,ml,gu,pa,or}.onnx and onnx/*_female.onnx), each trained exclusively on its own language's ai4bharat/Rasa or SPRINGLab/IndicTTS-English single-speaker 24 kHz studio recordings and native Unicode orthography.

CLI

npx ninada "Welcome to Ninada studio voice synthesis." -l en -v female -o english.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('मराठी भाषेची साहित्य परंपरा अत्यंत समृद्ध आहे.', 'mr');
const { aksharas } = textToIds('धर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः ।', 'sa');

studioTextToIds() tokenizes directly in each language's native Unicode character table (sa 144 tokens, en 102, hi 120, kn 85, mr 144, bn 100, ta 61, te 110, ml 101, gu 124, pa 85, or 94) — preserving Classical Sanskrit vocalic ṛ/ṝ/ḷ, visarga sandhi, Indian English retroflex & stress patterns, Kannada ಙ/ಃ allophony, Tamil ழ/ற/ன, Malayalam atomic chillus (ൺ ൻ ർ ൽ ൾ ൿ), Gurmukhi tippi/addak (ੰ/ੱ), and Odia/Bengali conjuncts feeding a 24 kHz RelativePositionTransformer + StochasticDurationPredictor + HiFi-GAN v1 studio generator.

Benchmarks (N = 480 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 29.4% 0.9 ms* 7.98 [7.81, 8.16] 65.16 dB 3.49s
Meta MMS 11-Specialist Fleet (11x VITS) 16 kHz 1526.8 MB 100.0% 204.2 ms 5.17 [5.12, 5.22] 64.97 dB 1.04s
ninada v5.0 Untuned Warm-Start (step=0) 24 kHz 112.0 MB 100.0% 196.1 ms 4.58 [4.54, 4.62] 10.93 dB 0.93s
ninada v5.0 Native Studio FP32 24 kHz 112.0 MB 100.0% 45.0 ms 3.27 [3.24, 3.30] 6.07 dB 0.60s
ninada v5.0 Native Browser ONNX 24 kHz 27.9 MB 100.0% 382.4 ms 3.27 [3.24, 3.29] 6.03 dB 0.60s
ninada Tier-2 Klatt Fallback 24 kHz 0.0 MB 100.0% 112.8 ms 10.53 [10.43, 10.64] 42.38 dB 0.88s

Per-language held-out MCD 0–8 kHz (dB, ↓): Punjabi 2.89 (vs 5.23 MMS), Marathi 3.10 (vs 4.62 MMS), Odia 3.11 (vs 5.49 MMS), Indian English 3.13 (vs 5.94 MMS), Tamil 3.21 (vs 4.87 MMS), Bengali 3.27 (vs 4.68 MMS), Gujarati 3.30 (vs 5.56 MMS), Malayalam 3.35 (vs 4.88 MMS), Hindi 3.36 (vs 4.85 MMS), Kannada 3.36 (vs 5.04 MMS), Sanskrit 3.51 (vs 5.32 MMS), Telugu 3.59 (vs 5.57 MMS). Full bootstrap CIs and parity telemetry (0.58 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/v5 --out-dir artifacts/ninada_v5
PYTHONPATH=python/src:. python bench/check_bench_thresholds.py
pytest -q && node verify-browser.mjs

Trains all 24 native 24 kHz Male/Female studio VITS specialists across 12 languages, evaluates 480 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 5.0.0

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 5.0.0
File Size Uploaded Provenance Actions
ninada-5.0.0.tar.gz 56.7 kB Without provenance Details for ninada-5.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 100.5 kB

Release files / ninada-5.0.0.tar.gz

Download URL ninada-5.0.0.tar.gz
Size 56.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f71f36321bcb539403d3dd76b15a0a9ab83250d5996b7e48cf95d28414688a3a
BLAKE2b-256 checksum
How to use checksums
44f8b87681f7eae7fc0be005ac41721ae42d308a0343ed3c19e653047d4f1099
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL ninada-5.0.0-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0fc28229e58c18803e466fa1db23f922558804320b924cc705d85e418dd58fd
BLAKE2b-256 checksum
How to use checksums
4ff459db7606d2c265b4ca254053a2754df09114800304a9e204d74ac223db21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ninada 5.0.0

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