SpeechRecognition
Library for performing speech recognition, with support for several engines and APIs, online and offline.
What it is and what it does
SpeechRecognition is a Python library that wraps multiple speech recognition engines and APIs into a unified interface. It supports both online services (Google, OpenAI Whisper, Azure, IBM, Groq, Cohere) and offline engines (CMU Sphinx, Vosk, local Whisper models), letting you choose based on accuracy, latency, and privacy needs. The library handles microphone input, audio file transcription, and audio stream processing.
The core use case is converting spoken audio to text in Python applications. You instantiate a Recognizer, load audio from a microphone or file, and call the appropriate recognition method for your chosen engine. Optional dependencies are only required for specific engines—the base install is lightweight. Python 3.9+ is required, and PyAudio is only needed if you want live microphone input.
Use it for:
- Build a voice command interface that listens to a microphone and executes actions based on recognized speech.
- Transcribe recorded audio files or meeting recordings using offline or cloud-based speech recognition.
- Create a chatbot or voice assistant that accepts spoken input and processes it as text.
- Implement accessibility features that convert user speech to text for applications.
- Prototype speech recognition workflows by switching between different engines without rewriting code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Performs speech recognition and transcription using multiple online and offline engines, including Google, OpenAI Whisper, CMU Sphinx, and others.
Yes. The package is actively maintained, has low install friction, supports modern Python versions (3.9+), carries no known vulnerabilities, and offers a practical abstraction over many speech engines. The permissive BSD-3-Clause license poses no restrictions. Install it when you need speech recognition and want to avoid vendor lock-in or when you want to experiment with multiple engines. The main gotcha is that most engines require optional dependencies or API credentials.
Install
speechrecognition on PyPI
pip
pip install speechrecognitionuv
uv add speechrecognitionpoetry
poetry add speechrecognitionInstalling SpeechRecognition
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (2026-06-17) and strong community engagement (8985 GitHub stars). Runtime dependencies are minimal; optional features require additional packages only when needed.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects.
Quickstart
pip install SpeechRecognition
from SpeechRecognition import Recognizer, Microphone
recognizer = Recognizer()
with Microphone() as source:
audio = recognizer.listen(source)
PyAudio 0.2.11+ is required only if you need microphone input; file-based transcription works without it. Most recognition engines require additional packages and API credentials.
Verify before relying
- Whether all listed engines (Google, Wit.ai, Azure, Houndify, IBM, Groq, Cohere) remain actively supported or if some are deprecated.
- Performance characteristics and accuracy differences between offline engines (Sphinx, Vosk, Whisper) and online APIs.
- Whether PyAudio 0.2.11+ is available on all target platforms or if installation barriers exist on some systems.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — typing-extensions, standard-aifc, audioop-lts |
| Maintenance | actively maintained — 58 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,744,922/month — #1,367 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: speechrecognition-3.17.0-py3-none-any.whl
Keywords: speech, recognition, voice, sphinx, google, wit, api, houndify, ibm, snowboy
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pocketsphinxPocketSphinx provides Python bindings for…
permissive · top 15,000 on PyPI
voskVosk provides offline speech recognition for…
permissive · top 15,000 on PyPI
whisperxWhisperX performs fast automatic speech…
permissive · top 5,000 on PyPI
openai-whisperWhisper performs multilingual speech…
permissive · top 5,000 on PyPI
assemblyaiPython SDK for transcribing and understanding…
permissive · top 5,000 on PyPI
mlx-whisperRuns OpenAI's Whisper speech recognition models…
permissive · top 15,000 on PyPI
sherpa-onnxSherpa-onnx runs speech recognition,…
permissive · top 15,000 on PyPI
sherpa-onnx-coresherpa-onnx-core provides pre-built ONNX…
permissive · top 15,000 on PyPI
realtimesttRealtimeSTT converts speech from microphone or…
permissive · top 15,000 on PyPI
pywhispercpppywhispercpp provides Python bindings for…
permissive · top 15,000 on PyPI