Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / speech / AGENTS.md

AGENTS.md3.0 KiBRenderedCodeRaw
1# AGENTS.md — speech/ (':speech')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `speech/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install speech (dev by default)._
6<!-- last-reviewed: 2026-10-16 -->
7- Gradle: :speech / dir: speech/
8- Package roots present: domain, platform, service
9- Entry files: MainActivity.kt (demo/settings UI) + service/WhisperRecognitionService.kt + service/SupertonicTtsService.kt (system service entries)
10- Deps: :library:ml, :library:downloadservice
11- Metadata: metadata_data/speech.md (present)
12- Rust: no / screenshotTest: yes
13
14## Overview
15**Purpose:** Fully offline speech-to-text (Whisper) + text-to-speech (Supertonic) that also serves as the system `SpeechRecognizer` and TTS engine. All models ship in-app; works on clean install.
16**Key features:**
17- Whisper-base STT bundled, GPU-accelerated via the repo compute runtime (`:library:ml`); `WhisperRecognitionService` answers system recognition requests
18- Supertonic 3 TTS, 10 voices × 31 languages (`SupertonicVoices` catalog); `SupertonicTtsService` answers system synthesis requests
19- `MainActivity` is only a demo/settings surface — the services are the product
20**Architecture / data-flow:** System binds `service/` endpoints → `util/WhisperEngine` (+ features/tokenizer/model) or `platform/SupertonicEngine` (+ `SupertonicModel`) → `:library:ml` GPU runtime; large assets ship bundled (`:library:downloadservice` only for updates/verification paths).
21**Entry points + reading order:** `service/WhisperRecognitionService.kt` / `service/SupertonicTtsService.kt` → `util/WhisperEngine.kt` / `platform/SupertonicEngine.kt` → `domain/SupertonicVoices.kt` → `MainActivity.kt` (demo UI).
22**Gotchas:**
23- `tts/` and `util/` are NOT closed package roots — pending migration; don't add more files there
24- Model files are large — asset/download changes need size + first-install testing, not just unit tests
25- System-service contracts (recognition/TTS callbacks) are version-sensitive; keep the service surface stable
26
27## Key files
28### service/ — system entries (the product)
29- com/vayunmathur/speech/service/WhisperRecognitionService.kt
30- com/vayunmathur/speech/service/SupertonicTtsService.kt
31### util/ — Whisper stack (pending migration to closed roots)
32- com/vayunmathur/speech/util/WhisperEngine.kt
33- com/vayunmathur/speech/util/WhisperModel.kt
34- com/vayunmathur/speech/util/WhisperFeatures.kt
35- com/vayunmathur/speech/util/WhisperTokenizer.kt
36- com/vayunmathur/speech/util/SpeechUiContract.kt
37### platform/ + domain/ — Supertonic stack
38- com/vayunmathur/speech/platform/SupertonicEngine.kt
39- com/vayunmathur/speech/platform/SupertonicModel.kt
40- com/vayunmathur/speech/domain/SupertonicVoices.kt
41### tts/ — voice-data check (pending migration to closed roots)
42- com/vayunmathur/speech/tts/CheckVoiceDataActivity.kt
43### Root — demo UI only
44- com/vayunmathur/speech/MainActivity.kt
45
46## Verify (this module only)
47```
48./gradlew :speech:compileDevKotlin
49./gradlew :speech:lint
50./gradlew :speech:checkMetadata
51```