Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / speech / AGENTS.md
| 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 | - Gradle: :speech / dir: speech/ |
| 7 | - Package roots present: domain, platform, service |
| 8 | - Entry files: MainActivity.kt (demo/settings UI) + service/WhisperRecognitionService.kt + service/SupertonicTtsService.kt (system service entries) |
| 9 | - Deps: :library:ml, :library:downloadservice |
| 10 | - Metadata: metadata_data/speech.md (present) |
| 11 | - Rust: no / screenshotTest: yes |
| 12 | |
| 13 | ## Overview |
| 14 | **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. |
| 15 | **Key features:** |
| 16 | - Whisper-base STT bundled, GPU-accelerated via the repo compute runtime (`:library:ml`); `WhisperRecognitionService` answers system recognition requests |
| 17 | - Supertonic 3 TTS, 10 voices × 31 languages (`SupertonicVoices` catalog); `SupertonicTtsService` answers system synthesis requests |
| 18 | - `MainActivity` is only a demo/settings surface — the services are the product |
| 19 | **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). |
| 20 | **Entry points + reading order:** `service/WhisperRecognitionService.kt` / `service/SupertonicTtsService.kt` → `util/WhisperEngine.kt` / `platform/SupertonicEngine.kt` → `domain/SupertonicVoices.kt` → `MainActivity.kt` (demo UI). |
| 21 | **Gotchas:** |
| 22 | - `tts/` and `util/` are NOT closed package roots — don't add more files there |
| 23 | - Model files are large — asset/download changes need size + first-install testing, not just unit tests |
| 24 | - System-service contracts (recognition/TTS callbacks) are version-sensitive; keep the service surface stable |
| 25 | |
| 26 | ## Key files |
| 27 | ### service/ — system entries (the product) |
| 28 | - com/vayunmathur/speech/service/WhisperRecognitionService.kt |
| 29 | - com/vayunmathur/speech/service/SupertonicTtsService.kt |
| 30 | ### util/ — Whisper stack |
| 31 | - com/vayunmathur/speech/util/WhisperEngine.kt |
| 32 | - com/vayunmathur/speech/util/WhisperModel.kt |
| 33 | - com/vayunmathur/speech/util/WhisperFeatures.kt |
| 34 | - com/vayunmathur/speech/util/WhisperTokenizer.kt |
| 35 | - com/vayunmathur/speech/util/SpeechUiContract.kt |
| 36 | ### platform/ + domain/ — Supertonic stack |
| 37 | - com/vayunmathur/speech/platform/SupertonicEngine.kt |
| 38 | - com/vayunmathur/speech/platform/SupertonicModel.kt |
| 39 | - com/vayunmathur/speech/domain/SupertonicVoices.kt |
| 40 | ### tts/ — voice-data check |
| 41 | - com/vayunmathur/speech/tts/CheckVoiceDataActivity.kt |
| 42 | ### Root — demo UI only |
| 43 | - com/vayunmathur/speech/MainActivity.kt |
| 44 | |
| 45 | ## Verify (this module only) |
| 46 | ``` |
| 47 | ./gradlew :speech:compileDevKotlin |
| 48 | ./gradlew :speech:lint |
| 49 | ./gradlew :speech:checkMetadata |
| 50 | ``` |