About this project

SpeechRecognition is a widely used Python library that provides a unified interface for performing speech recognition across a broad range of engines and APIs, both online and offline. It abstracts away the complexity of integrating with different speech-to-text services, allowing developers to switch between providers with minimal code changes. Supported engines and APIs include CMU Sphinx (offline), Google Speech Recognition, Google Cloud Speech API, Wit.ai, Microsoft Azure Speech, Houndify API, IBM Speech to Text, Snowboy Hotword Detection (offline), TensorFlow, Vosk API (offline), OpenAI Whisper (offline), OpenAI Transcription API (including OpenAI-compatible self-hosted endpoints such as vLLM and Ollama), Groq Whisper API, and Cohere Transcribe API. The library requires Python 3.10 or later. Optional dependencies are installed via pip extras: PyAudio for microphone input, PocketSphinx for the Sphinx recognizer, google-cloud-speech for Google Cloud Speech-to-Text, Vosk for offline recognition, Whisper or Faster Whisper for local transcription, openai for the OpenAI Transcription API, groq for the Groq Whisper API, and cohere for the Cohere Transcribe API. A FLAC encoder is bundled for x86-based Windows, Linux, and OS X systems but must be installed separately on other platforms. Key features include microphone-based speech capture, audio file transcription, background listening, energy threshold calibration for ambient noise, and extended recognition results. The library provides a simple API with methods such as recognize_sphinx, recognize_google, recognize_google_cloud, recognize_wit, recognize_api, recognize_houndify, recognize_ibm, recognize_snowboy, recognize_tensorflow, recognize_vosk, recognize_whisper, recognize_faster_whisper, recognize_openai, recognize_groq, and recognize_cohere_api. The repository includes a comprehensive examples directory with usage patterns for microphone recognition, audio file transcription, saving audio data, extended results, energy threshold calibration, background listening, and special recognizer features. Troubleshooting documentation covers common issues such as false triggers, language/dialect support, Raspberry Pi microphone problems, PyInstaller compatibility, and platform-specific audio errors. The library is published on PyPI and is actively maintained with contributions from multiple authors. It is suitable for developers building voice-enabled applications, transcription tools, and speech-driven interfaces who need flexibility in choosing between cloud-based and on-device speech recognition solutions.