Receive Accessible Error Messages for Recognition Failures
The Speech Recognition Service identifies and categorizes recognition failures into distinct error states: microphone permission denied, no speech detected within the timeout window, network unavailable (if any fallback path requires connectivity), recognition engine initialization failure, and unrecoverable device error. Each error state is surfaced via the Voice Recording Control as an accessible inline message with a brief, plain-language explanation and a suggested recovery action (e.g., 'No speech detected — tap the mic to try again'). Error messages are announced by screen readers. The text field is never modified when an error occurs.
User Story
Acceptance Criteria
- Given the peer mentor taps the mic but does not speak within the timeout window, when the session expires, then a 'No speech detected' message is shown with a retry prompt
- Given microphone permission was revoked in device Settings between sessions, when the peer mentor taps the mic, then a 'Microphone access required' message is shown with a link to device Settings
- Given the native speech engine fails to initialize (e.g., locale not supported), when recording is attempted, then an accessible error message is shown and the field remains unchanged
- Given any error occurs, when a screen reader is active, then the error message is announced automatically without requiring navigation
- Given an error has been displayed, when the peer mentor taps the mic again, then the error clears and a new session can begin
Business Value
For users with visual impairments or cognitive challenges, silent or cryptic failures are especially disorienting. Clear, actionable error messages prevent users from assuming the feature is broken, and ensure the fallback path (manual typing) is obvious. This is particularly important for Blindeforbundet users who may be relying on speech input as their primary input method.
Components
- Voice Recording Control ui
- Speech Recognition Service service
- Speech API Gateway infrastructure