Stop or Cancel a Recording Session
The Voice Recording Control displays distinct Stop and Cancel actions during an active session. Tapping Stop finalizes the current recognition session: the Speech Recognition Service returns the final transcript and the Speech Input Widget injects it into the text field. Tapping Cancel aborts the session, discards any partial transcript, and leaves the text field unchanged. Both actions are accessible via screen reader with appropriate labels. Sessions also auto-stop after a configurable silence timeout (e.g., 3 seconds of silence after speech is detected) to handle cases where the user walks away or forgets to tap Stop.
User Story
Acceptance Criteria
- Given a recording session is active, when the peer mentor taps Stop, then the session finalizes, the last recognized transcript is inserted into the text field, and the recording UI closes
- Given a recording session is active, when the peer mentor taps Cancel, then the session is aborted, no text is inserted or modified, and the field retains its previous content
- Given a recording session is active and the peer mentor stops speaking, when silence continues for the configured timeout (e.g., 3 seconds), then the session auto-stops and inserts the recognized transcript
- Given Stop and Cancel controls are rendered, when a screen reader user navigates to them, then each control announces its action label clearly
- Given the session ends via any method, when the UI updates, then the microphone icon returns to its idle state and is available for a new session
Business Value
Explicit stop/cancel controls are essential for user trust and data integrity. Without a cancel option, users who misspeak or record ambient noise have no clean way to discard the result. Auto-stop on silence prevents the app from staying in a recording state indefinitely, which would be alarming in a context where privacy around sensitive health conversations is paramount.