How zt-fang/eyeopener-translator works
EyeOpener is an Android real-time speech translation app that overlays subtitles on other apps. The main flow captures microphone or device audio, filters speech, recognizes it with a language-selected offline engine, translates finalized text, and presents subtitle state in a movable floating window; model downloads and settings support that flow. The README also documents history, an AI chat assistant, cloud/AI translation, and personalization. Edges are limited to README statements and shown source references/calls; several UI and translation implementations were not sampled, so their internal wiring is omitted.
Main entry points: SubtitleManager.kt Subtitle manager · TranslationEngine.kt Translation choices · MainActivity.kt Main activity · ModelPreparer.kt Model preparation
Components 24
App experience
- Main activity
app/src/main/java/io/github/ztfang/eye/MainActivity.kt - Floating subtitles
app/src/main/java/io/github/ztfang/eye/FloatingSubtitleService.kt - Assistant chat
app/src/main/java/io/github/ztfang/eye/MainActivity.kt - Settings
app/src/main/kotlin/io/github/ztfang/eye/viewmodel/SettingsViewModel.kt - History screen
app/src/main/kotlin/io/github/ztfang/eye/ui/screen/HistoryScreen.kt
Speech processing
- Subtitle manager
app/src/main/kotlin/io/github/ztfang/eye/viewmodel/SubtitleManager.kt - Speech detection
engine/src/main/kotlin/io/github/ztfang/eye/engine/vad/SileroVadEngine.kt - Sherpa ASR
engine/src/main/kotlin/io/github/ztfang/eye/engine/asr/SherpaOnnxAsrEngine.kt - Vosk ASR
engine/src/main/kotlin/io/github/ztfang/eye/engine/asr/VoskAsrEngine.kt
Models and translation
- Model preparation
engine/src/main/kotlin/io/github/ztfang/eye/engine/ModelPreparer.kt - Model management UI
app/src/main/kotlin/io/github/ztfang/eye/ui/screens/LocalModelsScreen.kt - Translation choices
domain/src/main/kotlin/io/github/ztfang/eye/domain/model/TranslationEngine.kt - Local translation
- Cloud translation
- AI translation
Local persistence
- History repository
data/src/main/kotlin/io/github/ztfang/eye/data/repository/HistoryRepositoryImpl.kt - History database
data/src/main/kotlin/io/github/ztfang/eye/data/local/database/AppDatabase.kt - History DAO
data/src/main/kotlin/io/github/ztfang/eye/data/local/dao/HistoryDao.kt - Settings repository
data/src/main/kotlin/io/github/ztfang/eye/data/repository/SettingsRepositoryImpl.kt - Settings store
data/src/main/kotlin/io/github/ztfang/eye/data/local/datastore/SettingsDataStore.kt
Other components
- User
- Cloud providers
- LLM service
- Device audio
Connections 24
- User → Main activity: opens and configures
README.md - Main activity → Floating subtitles: starts overlay
app/src/main/java/io/github/ztfang/eye/MainActivity.kt - Floating subtitles → Subtitle manager: starts processing
app/src/main/java/io/github/ztfang/eye/FloatingSubtitleService.kt - Device audio → Subtitle manager: provides audio
README.md - Subtitle manager → Speech detection: checks speech
app/src/main/kotlin/io/github/ztfang/eye/viewmodel/SubtitleManager.kt - Subtitle manager → Sherpa ASR: selects engine
app/src/main/kotlin/io/github/ztfang/eye/viewmodel/SubtitleManager.kt - Subtitle manager → Vosk ASR: selects engine
app/src/main/kotlin/io/github/ztfang/eye/viewmodel/SubtitleManager.kt - Subtitle manager → Floating subtitles: updates subtitle state
app/src/main/java/io/github/ztfang/eye/FloatingSubtitleService.kt - Subtitle manager → Translation choices: uses selected mode
app/src/main/kotlin/io/github/ztfang/eye/viewmodel/SubtitleManager.kt - Translation choices → Local translation: selects local
domain/src/main/kotlin/io/github/ztfang/eye/domain/model/TranslationEngine.kt - Translation choices → Cloud translation: selects cloud
domain/src/main/kotlin/io/github/ztfang/eye/domain/model/TranslationEngine.kt - Translation choices → AI translation: selects AI
domain/src/main/kotlin/io/github/ztfang/eye/domain/model/TranslationEngine.kt - Cloud translation → Cloud providers: uses provider
README.md - AI translation → LLM service: calls configured API
README.md - Model preparation → Sherpa ASR: prepares engine
engine/src/main/kotlin/io/github/ztfang/eye/engine/ModelPreparer.kt - Model preparation → Vosk ASR: prepares engine
engine/src/main/kotlin/io/github/ztfang/eye/engine/ModelPreparer.kt - Model management UI → Model preparation: requests models
- Subtitle manager → History repository: records history
- History screen → History repository: browses records
README.md - History repository → History DAO: reads and writes
data/src/main/kotlin/io/github/ztfang/eye/data/repository/HistoryRepositoryImpl.kt - History database → History DAO: provides
data/src/main/kotlin/io/github/ztfang/eye/data/local/database/AppDatabase.kt - Settings → Settings repository: reads and updates
- Settings repository → Settings store: persists preferences
data/src/main/kotlin/io/github/ztfang/eye/data/repository/SettingsRepositoryImpl.kt - Main activity → Assistant chat: hosts chat
README.md