Wear OS Dictation IME
Relevant source files
The following files were used as context for generating this wiki page:
The Wear OS Dictation IME is a specialized Input Method Editor (IME) designed for smartwatches, serving as a companion to the main Ownkey Keyboard application. Its primary purpose is to provide a reliable "transcript-first" voice input experience on Wear OS devices, utilizing the Mistral Voxtral ASR (Automatic Speech Recognition) system.
Sources: README.md:16-18, VOXTRAL_KEYBOARD_PLAN.md:8-12
This system allows users to "Bring Your Own Key" (BYOK) for AI services, ensuring privacy and user control over the transcription endpoint and model. It supports phone-to-watch configuration synchronization for seamless setup of API keys and endpoint URLs.
Sources: README.md:9-11, AGENTS.md:14-16
Architecture and Components
The Wear OS module is structured into three primary layers: the UI layer (Main Activity), the Service layer (IME), and the Integration layer (Transcription).
System Component Overview
The diagram shows the internal components of the Wear OS module and their relationship with the external ASR service.
Sources: MainActivity.kt:80-84, OwnkeyWearImeService.kt:33-40, WearTranscription.kt:15-18
Key Classes
| Class | Description |
|---|---|
OwnkeyWearImeService | The core IME service that intercepts input requests and launches the dictation UI. |
MainActivity | Orchestrates the Compose-based UI for recording, processing, and reviewing transcripts. |
VoxtralWearClient | Handles network requests to the transcription API (defaulting to Mistral). |
WearSettingsStore | Manages local storage of API keys, endpoint URLs, and saved session data. |
Sources: OwnkeyWearImeService.kt:25, MainActivity.kt:79, WearTranscription.kt:81, MainActivity.kt:100
Dictation Flow and State Machine
The dictation process follows a strict state machine from initialization to final text commit. Users start from a "Ready" state, record audio, wait for processing, and then review or edit the resulting text.
Transcription Sequence
The sequence illustrates the flow from local audio capture to external API transcription and final review.
Sources: MainActivity.kt:152-192, MainActivity.kt:246-278, WearTranscription.kt:86-105
Data Flow Logic
- Audio Capture: Audio is recorded and stored temporarily as a URI.
- Transcription Request: The
VoxtralWearClientconstructs a multipart request containing the audio file, model ID, and optional language hints. - Segmentation: Raw transcript strings are parsed into
EditableTranscriptSegmentobjects, allowing users to correct AI errors manually. - Export: Finalized text is copied to the system clipboard and shared via standard Android intent filters.
Sources: MainActivity.kt:145-150, MainActivity.kt:252-278, MainActivity.kt:660-681
Configuration and Security
Following the project's privacy-first model, the Wear OS IME ensures that sensitive data like API keys are managed securely.
Secure Settings Management
Settings can be synced from the phone app or entered manually on the watch.
- API Key Storage: Stored locally on-device via
WearSettingsStore. - BYOK (Bring Your Own Key): Users must provide their own Mistral or OpenAI-compatible keys.
- Endpoint Customization: Supports self-hosted OpenAI-compatible transcription endpoints.
Sources: MainActivity.kt:135-140, README.md:27-30, VOXTRAL_KEYBOARD_PLAN.md:39-44
Configuration Parameters
| Parameter | Default Value | Description |
|---|---|---|
Endpoint URL | https://api.mistral.ai/v1/audio/transcriptions | The API endpoint for ASR processing. |
Model | voxtral-mini-latest | The specific ASR model to utilize. |
Language Hint | (Empty) | ISO language code (e.g., "en", "nl") to improve recognition. |
Sources: WearTranscription.kt:82-83, MainActivity.kt:105-115
UI and UX Design
The Wear OS interface is optimized for small, circular displays using Material You styling.
UI Routes
The MainActivity manages several distinct screens:
- Home: Dashboard showing provider status and session metrics (session count, average duration).
- Recording: High-contrast recording interface with waveform visualizations.
- Processing: Loading state with circular progress indicators during API calls.
- Review: A
LazyColumnof transcript segments allowing speaker identification and text editing.
Sources: MainActivity.kt:86-93, MainActivity.kt:453-480, MainActivity.kt:545-560
User Experience Features
- WaveformBars: Visual feedback during audio capture using infinite transitions and scaling.
- Metric Chips: Quick-glance data on total sessions and duration.
- Provider Status: A color-coded chip indicating if the transcription provider is active or requires setup.
Sources: MainActivity.kt:630-645, MainActivity.kt:700-725, MainActivity.kt:732-758
Conclusion
The Wear OS Dictation IME extends the Ownkey Keyboard ecosystem by providing a high-quality, privacy-centric voice input method for wearables. By decoupling the transcription service from the keyboard itself through a BYOK model and providing a robust editing interface, it addresses the common reliability issues of standard smartwatch voice input. Its architecture focuses on low-friction synchronization with the primary Android application while maintaining standalone functionality for recording and review.