A full-featured, open-source Marathi Text-to-Speech ecosystem spanning three platforms: Web (Django), Desktop (JavaFX + Kotlin), and Mobile (Android + Chaquopy).
| Platform | Stack | Status |
|---|---|---|
| Web | Django 5.2 · DRF · gTTS · Coqui TTS · Whisper | Production |
| Desktop | JavaFX · Kotlin · Python bridge (subprocess) | Production |
| Mobile | Android (API 26+) · Kotlin · Chaquopy Python 3.11 | Production |
| # | Feature | Web | Desktop | Mobile |
|---|---|---|---|---|
| 1 | Basic TTS (Marathi text → speech) | ✅ | ✅ | ✅ |
| 2 | Verse / Stotra mode (shloka-aware pauses) | ✅ | ✅ | ✅ |
| 3 | Stotra library (pre-recorded catalog) | — | ✅ | ✅ (text) |
| 4 | Sanskrit phonetics (visarga sandhi, echoing, halant) | ✅ | ✅ | ✅ |
| 5 | Marathi phonetics (schwa deletion, anusvara, conjuncts) | ✅ | ✅ | ✅ |
| 6 | G2P engine (grapheme-to-phoneme) | ✅ | ✅ | ✅ |
| 7 | Text correction (ML-powered) | ✅ | ✅ | ✅ |
| 8 | Emotion analysis (8-class) | ✅ | ✅ | ✅ |
| 9 | Image OCR (Devanagari) | ✅ | ✅ | ✅ |
| 10 | PDF extraction (PyMuPDF → PyPDF2 → OCR) | ✅ | ✅ | ✅ |
| 11 | Web scraping (URL → Marathi text) | ✅ | ✅ | ✅ |
| 12 | Speech-to-Text (Whisper / Android SpeechRecognizer) | ✅ API | ✅ Tab | ✅ Tab |
| 13 | Script conversion (Modi / IAST / Brahmi ↔ Devanagari) | ✅ | ✅ | ✅ |
| 14 | Multi-engine TTS (gTTS / System / Sherpa AI) | Partial | Partial | ✅ |
| 15 | Prosody engine (natural pauses) | ✅ | Partial | — |
| 16 | Grammar engine (90+ spelling fixes, sandhi, vibhakti) | ✅ | ✅ | ✅ |
| 17 | Number-to-words (currency, dates, ordinals) | ✅ | ✅ | ✅ |
| 18 | Morphological analysis (Morfessor) | ✅ | — | — |
| 19 | Dictionary lookup | ✅ | — | — |
| 20 | Streaming TTS | ✅ | — | — |
| 21 | Custom voice model (VITS / XTTS v2) | ✅ | — | — |
| 22 | User system / feedback | ✅ | — | — |
| 23 | Theme support (Material3 DayNight) | — | — | ✅ |
| 24 | Book Reader (CameraX + perspective crop + sentence TTS) | — | — | ✅ |
| 25 | Stotra Library (full text + API) | ✅ API | ✅ Tab | ✅ Tab |
A shared Python module (marathi_phonetics.py) provides comprehensive pronunciation rules
for both Sanskrit and Marathi text across all three platforms:
- Terminal halant expansion (म् → म before space/punct/end)
- Visarga sandhi: before palatals → श, retroflexes → ष, dentals → स, velars/labials → ह
- Echoing terminal visarga: after इ → हि, उ → हु, ए → हे, default → हा
- Conjuncts: ज्ञ → द्न्य, ॠ → री
- OM symbol → ओम
- Visarga word lexicon (दुःख → दुख्ख, निःशब्द → निश्शब्द, etc.)
- Classical trailing anusvara cleanup
- Schwa deletion lexicon (~20 known problem words)
- English vowel normalization (ॲ → ए for System TTS)
- Conjuncts and OM handling
Raw text
→ MarathiGrammarEngine — spelling/grammar/word-order fixes
→ MarathiTextNormalizer — visarga, abbreviations, numbers → words
→ apply_marathi_phonetics — phonetic rules (schwa, anusvara, conjuncts)
→ MarathiG2PEngine — grapheme-to-phoneme processing
→ EmotionAnalyzer — detect emotion → voice parameters
→ TTS Engine — generate audio segments
→ Audio post-processing — speed/pitch/volume/EQ
→ Output (MP3/WAV)
cd marathi_tts_web
python -m venv .venv && .venv/Scripts/activate # or source .venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver.\start_desktop.ps1 # Windows
# or
cd marathi_tts_desktop && ./gradlew run.\deploy_mobile.ps1 # Build + deploy to connected device
# or
cd marathi_tts_mobile && ./gradlew assembleDebugAll Python dependencies are scanned with pip-audit and bandit.
| Category | Status |
|---|---|
| Django | 5.2.11 (all CVEs patched) |
| pip | 26.0.1 |
| setuptools | 82.0.0 |
| SSL verification | verify=True on all HTTP requests |
| File permissions | 0o755 (not 0o777) |
| Hash functions | SHA-256 (not MD5) for cache keys |
| HuggingFace | Local model loading (no unpinned downloads in prod) |
marathi_tts/
├── marathi_tts_web/ # Django web application
├── marathi_tts_desktop/ # JavaFX + Kotlin desktop app
├── marathi_tts_mobile/ # Android + Chaquopy mobile app
├── deploy_mobile.ps1 # Mobile build & deploy script
├── start_desktop.ps1 # Desktop launch script
├── check_runtime_logs.ps1 # Android logcat viewer
└── README.md # This file
Contributions are welcome! Please read CONTRIBUTING.md for details on code style, phonetic rules, engine synchronization, and the pull request process.
Please review our Security Policy to report any security vulnerabilities.
GNU General Public License v3.0
- Coqui TTS — open-source TTS framework
- OpenAI Whisper — speech recognition
- Tesseract OCR — OCR engine
- AI4Bharat — Indic NLP resources
- Chaquopy — Python on Android
- Google ML Kit — on-device text recognition