A React hook that actually listens to you
Wraps the browser's Web Speech API into a hook so your components can transcribe microphone input without managing the global state themselves.

What it does
useSpeechRecognition is a React hook that pipes microphone audio through the browser’s Web Speech API and hands you back a transcript, plus booleans for whether it’s currently listening and whether the browser even supports speech recognition. A separate SpeechRecognition object manages the global microphone state—start, stop, abort—across all components.
The interesting bit
The library is essentially a thin, well-shaped wrapper around a notoriously flaky API. The useful work happens in the escape hatches: it explicitly supports polyfills (Azure Cognitive Services is documented) so you can bypass Chrome’s monopoly on decent speech recognition, avoid shipping voice data to Google, and get consistent behavior across browsers. That’s the part most “just use the platform” tutorials skip.
Key highlights
- Hook returns
transcript,listening,resetTranscript,browserSupportsSpeechRecognition, andisMicrophoneAvailable - Command matching built-in: exact string/regex matches, plus optional fuzzy matching for misheard phrases
- Global microphone state managed outside React’s tree via
SpeechRecognition.startListening()and friends - Polyfill support documented for Azure; without one, you’re mostly stuck on Chrome, Edge, and Safari 14.1+
- Requires React 16.8+; v2.x exists for legacy React
Caveats
- Native support is genuinely thin outside Chrome-family browsers; the README is upfront that you’ll want a polyfill for anything serious
- Android Chrome beeps at you when the mic turns on—OS-level behavior, not fixable from the browser
- No polyfill is bundled; you bring your own (and your own cloud credentials)
Verdict
Grab this if you need voice commands or transcription in a React app and don’t want to hand-roll Web Speech API state management. Skip it if you need universal browser support without paying for a speech API, or if your users are mostly on Firefox.