Created: 2026-11-09

Dictation

Dictation

Dictation

  •  Introduction

    This is a live dictation system that turns your voice into text on the page. Speak and words appear in the paper as you talk, ready to be read back, edited, or saved. It sits alongside the Read button so speech input and speech output work as a pair.

    Dictated text is inserted at the cursor, not always at the end, so you can click into a paragraph, speak a correction, and continue. The button shows Listening... while the microphone is active, so you always know when the system is capturing.

    It is designed to feel like speaking directly onto paper. Whether you are drafting notes, dictating a reply, or capturing a thought before it is lost, the paper stays live and editable throughout.

  •  Technical Intro

    The system is built on the Web Speech API's SpeechRecognition interface, running entirely in the browser with no server component. Audio goes to the browser's built-in speech engine; nothing leaves the device unless the engine itself is cloud-based (Chrome, Safari).

    Recognition runs in continuous mode with interim results enabled. Final transcripts are appended to the paper at the current cursor position, using the DOM Selection API to insert a text node and advance the caret. If no cursor is placed inside the paper, text falls back to append-at-end so nothing is lost.

    Two global functions are exposed: toggleDictation() starts or stops, and stopDictation() stops only. The Read button calls stopDictation() before speaking, so speech input and speech output never run at the same time. Starting dictation calls reset() on the reader, stopping any in-progress playback.

    Browser support is detected at runtime. If SpeechRecognition is unavailable, the button disables itself and shows No dictation support rather than failing silently. Chrome, Edge, Chromium, and Safari are supported; Firefox is not.

    Session state is minimal. Dictation writes only to nanoPaperState to mark the paper as edited, which prevents the demo text from reappearing on reload. Voice, rate, and pitch settings are unaffected and remain managed by the reader's own storage keys.

    The recognition session auto-recovers from idle timeouts. If the browser ends recognition after a pause, onend restarts it as long as the user has not pressed the button to stop. This keeps long dictation sessions working without re-taps.