concept · Web API · Speech
Dictation Demo
A note-dictation interface that uses unspokenPunctuation: true. Speak in natural sentences — pause at the end of each thought — and receive a formatted, punctuated document without saying "period" or "comma" aloud.
Your browser does not support the Web Speech API (SpeechRecognition). Try Chrome 151+ on desktop.
Tip: Click the microphone button, then speak naturally. Pause briefly between sentences. With
unspokenPunctuation enabled, the engine infers periods and commas from your cadence. Toggle it off to see raw output.
Click "Dictate" and speak naturally…
0 words
0 characters
The key to a good dictation experience is not just transcription accuracy — it is document readability. Raw transcripts are word streams without structure. With
unspokenPunctuation, the recognizer uses prosodic cues (pause length, pitch fall) to decide where sentences end and where natural pauses warrant commas. The developer's code does not change at all — only the boolean on the SpeechRecognition instance.
the code
const recognition = new SpeechRecognition();
recognition.continuous = true;
recognition.interimResults = true;
recognition.lang = 'en-US';
// The new Chrome 151 property:
recognition.unspokenPunctuation = true;
recognition.onresult = (event) => {
let finalText = '';
let interimText = '';
for (let i = event.resultIndex; i < event.results.length; i++) {
const transcript = event.results[i][0].transcript;
if (event.results[i].isFinal) {
finalText += transcript; // "Hello, how are you? Good, thanks."
} else {
interimText = transcript; // live preview while speaking
}
}
updateEditor(finalText, interimText);
};
see also
- Punctuation Transcription — side-by-side on/off comparison
- ChromeStatus entry
- MDN — SpeechRecognition
- Web Speech API specification (WICG)
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗