Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/arverma/Bihar-Police-Notebook/llms.txt

Use this file to discover all available pages before exploring further.

The voice dictation feature lets you speak your document content aloud and have it typed for you in real time. It uses the browser’s built-in Web Speech API — no third-party service or plugin is needed. Dictation is available on desktop and tablet only; on phones the floating action button (FAB) is hidden in favour of the device keyboard’s own microphone key.

Starting Dictation

A microphone floating action button (FAB) appears in the lower corner of the screen on desktop and tablet. Click it to start a dictation session. The FAB is draggable — move it out of the way if it overlaps your text.
On screens 768 px wide or narrower, the FAB is hidden and syncFabVisibility() stops the engine automatically if the window is resized into the mobile breakpoint. Use your phone keyboard’s microphone button instead.

Session States

The dictation engine moves through these states:
StateWhat it means
idleNo session active. Microphone is not in use.
listeningRecognition is running. Spoken words are transcribed in real time.
pausedSession is open but recognition is temporarily stopped. Click the FAB or press the shortcut to resume.
needs-consentNo on-device language pack was found. The app is waiting for your permission to use online (cloud) recognition.
errorA microphone or recognition error occurred (e.g. permission denied, service unavailable).

On-Device vs. Cloud Recognition

1

Check for an on-device pack

When you start dictation the engine calls probePackAvailability('hi-IN') using the SpeechRecognition.available() API. If Chrome has the Hindi (hi-IN) language pack installed locally, recognition runs entirely on your device — no audio is sent over the network.
2

Ask for consent if the pack is missing

If no local pack is found, the app enters the needs-consent state and shows a consent sheet explaining that audio will be sent to Google’s cloud recognition service. No audio is stored by the app.
3

Proceed with cloud after consent

If you allow cloud recognition, setCloudConsent('hi-IN', true) stores your preference and continueWithCloud() restarts the session with processLocally: false. Your preference is remembered for future sessions.
4

Stay idle if consent is denied

If you deny cloud use and no local pack is available, the session ends and the engine returns to idle.

Spoken Punctuation

You can insert punctuation and line breaks by speaking their names aloud. The applyVoiceEdits() function replaces recognised phrases with the correct glyphs after each final result:
Spoken phraseInserted text
”पूर्ण विराम”
“अल्पविराम”,
“प्रश्न चिह्न”?
”नया पैराग्राफ” or “new paragraph”(blank line)
“नई लाइन” or “new line”(line break)
“full stop”
“comma”,
“question mark”?
// From editor/js/dictation.js
const PUNCT_PHRASES = [
    ['नया पैराग्राफ', '\n\n'],
    ['नई लाइन', '\n'],
    ['पूर्ण विराम', '।'],
    ['अल्पविराम', ','],
    ['प्रश्न चिह्न', '?'],
    ['new paragraph', '\n\n'],
    ['new line', '\n'],
    ['full stop', '।'],
    ['question mark', '?'],
    ['comma', ','],
];
Phrases are matched case-insensitively and trailing spaces around inserted punctuation are cleaned up automatically.

Audio Level Metering

While the session is in the listening state, an AnalyserNode reads the RMS amplitude of the microphone stream 60 times per second and emits a normalised level value (0–1) via the onLevel callback. The FAB uses this value to display a real-time audio level indicator so you can see when your voice is being picked up.
// Simplified from editor/js/dictation.js
analyser.getByteTimeDomainData(data);
let sum = 0;
for (let i = 0; i < data.length; i++) {
    const v = (data[i] - 128) / 128;
    sum += v * v;
}
const rms = Math.sqrt(sum / data.length);
callbacks.onLevel(Math.min(1, rms * 3));

Idle Timeout

A session that receives no speech automatically stops after 2 minutes of silence. This prevents the microphone from remaining open indefinitely. You can resume at any time by clicking the FAB or pressing Ctrl + Shift + D again.

Ending a Session

  • Press Esc to end an active dictation session immediately.
  • Click the FAB while listening or paused to toggle pause / resume.
  • The session also ends automatically on idle timeout or if a fatal error occurs.

Supported Languages

Language codeDescription
hi-INHindi (default)
en-INEnglish (India)
The language can be changed from the dictation settings sheet. Switching language during an active session restarts recognition in the new language immediately.
For the best results with Hindi dictation, install the Hindi speech recognition language pack in Chrome Settings → Languages → Manage languages. On-device recognition is faster, works offline, and does not require cloud consent.

Build docs developers (and LLMs) love