Python speech recognition libraries

Updated Nov 2026

Python speech recognition libraries turn recorded or live audio into text. Many run a trained model such as Whisper on the local machine rather than sending audio to a hosted service. These libraries let voice agents, meeting tools, and captioning apps act on what people say.

Popularity

Transformers has the most monthly downloads in this comparison, at 119.8M, a count that covers every model task in the library.

LibraryMonthly downloadsStarsLast releaseLicense
Transformers
119.8M
169.2KNov 2026Apache-2.0
faster-whisper
19.8M
26.8KOct 2025MIT
SpeechRecognition
6.6M
9.0KJun 2026BSD-3-Clause
openai-whisper
6.3M
112.8KJun 2025MIT
TorchAudio
5.8M
3.0KOct 2026BSD-2-Clause
sherpa-onnx
4.2M
16.0KOct 2026Apache-2.0
SpeechBrain
1.6M
11.9KOct 2026Apache-2.0
Vosk
1.3M
15.3KDec 2022Apache-2.0
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Defines machine learning models for text, vision, audio, and multimodal tasks.

Downloads / mo
119.8M
Stars
169.2K
Last release
5.23.0
License
Apache-2.0
$ pip install "transformers[torch]"
from transformers import pipeline

transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base.en", device="cpu")
print(transcriber("audio.wav")["text"])

Transformers examples

From open-source projects on GitHub

faster-whisper

Runs Whisper speech recognition through CTranslate2, with batched inference and optional word timestamps.

Downloads / mo
19.8M
Stars
26.8K
Last release
1.2.1
License
MIT

Strengths

  • Transcribes audio in batches. BatchedInferencePipeline adds batched transcription around a WhisperModel.
  • Decodes files through bundled FFmpeg. PyAV supplies FFmpeg libraries without a separate system FFmpeg installation.

Limitations

  • Segments are generated lazily. Iterate over segments to run transcription and collect the results.
  • GPU setup needs matching libraries. Current GPU releases require matching CUDA and cuDNN libraries.

Quickstart

From README.md
$ pip install faster-whisper
from faster_whisper import WhisperModel

model = WhisperModel("tiny", device="cpu", compute_type="int8")
segments, info = model.transcribe("audio.mp3")
for segment in segments:
    print(segment.text)

faster-whisper examples

From open-source projects on GitHub

SpeechRecognition

Provides one Python interface to multiple online recognition services and optional offline speech engines.

Downloads / mo
6.6M
Stars
9.0K
Last release
3.17.0
License
BSD-3-Clause

Strengths

  • Switches between recognition engines. Choose online services or local engines through the same recognizer interface.
  • Reads existing audio recordings. Load recorded audio files before passing them to a recognizer.

Limitations

  • Microphone capture needs PyAudio. Install microphone dependencies separately before recording speech.
  • Offline engines need separate installs. Install the selected local engine before using its recognizer.
$ pip install SpeechRecognition
import speech_recognition as sr

r = sr.Recognizer()
audio = sr.AudioData.from_file("audio.wav")
print(r.recognize_google(audio))

SpeechRecognition examples

From open-source projects on GitHub

openai-whisper

Provides local multilingual speech recognition, language identification, and speech-to-English translation with Whisper models.

Downloads / mo
6.3M
Stars
112.8K
Last release
20250625
License
MIT

Strengths

  • Recognizes speech across languages. Use multilingual models for transcription, translation, and language identification.
  • Exposes lower-level decoding functions. Use detect_language and decode to control the decoding workflow.

Limitations

  • Audio loading needs system FFmpeg. Install the FFmpeg command-line tool alongside the Python package.
  • Turbo skips translation into English. Select a multilingual model trained for speech translation instead.

Quickstart

From README.md
$ pip install openai-whisper
import whisper

model = whisper.load_model("turbo")
result = model.transcribe("audio.mp3")
print(result["text"])

openai-whisper examples

From open-source projects on GitHub

Processes audio in PyTorch.

Downloads / mo
5.8M
Stars
3.0K
Last release
2.11.1
License
BSD-2-Clause

Quickstart

From impl.py
$ pip install torchaudio
import torchaudio

bundle = torchaudio.pipelines.WAV2VEC2_ASR_BASE_960H
model = bundle.get_model()
print(bundle.get_labels())

TorchAudio examples

From open-source projects on GitHub

sherpa-onnx

Recognizes speech.

Downloads / mo
4.2M
Stars
16.0K
Last release
2.0.1
License
Apache-2.0
$ pip install sherpa-onnx numpy
import wave
import numpy as np
import sherpa_onnx

recognizer = sherpa_onnx.OfflineRecognizer.from_nemo_ctc(
    model="model.onnx", tokens="tokens.txt"
)
with wave.open("speech.wav", "rb") as wav:
    assert wav.getnchannels() == 1 and wav.getsampwidth() == 2
    samples = np.frombuffer(wav.readframes(wav.getnframes()), dtype=np.int16).astype(np.float32) / 32768
    sample_rate = wav.getframerate()
stream = recognizer.create_stream()
stream.accept_waveform(sample_rate, samples)
recognizer.decode_stream(stream)
print(stream.result.text)

Provides an all-in-one speech toolkit in Python and PyTorch.

Downloads / mo
1.6M
Stars
11.9K
Last release
1.1.2
License
Apache-2.0

Quickstart

From README.md
$ pip install speechbrain
from speechbrain.inference import EncoderDecoderASR

asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-conformer-transformerlm-librispeech", savedir="pretrained_models/asr-transformer-transformerlm-librispeech")
asr_model.transcribe_file("speechbrain/asr-conformer-transformerlm-librispeech/example.wav")

SpeechBrain examples

From open-source projects on GitHub

Runs offline speech recognition with per-language models and a streaming recognition interface.

Downloads / mo
1.3M
Stars
15.3K
Last release
0.3.45
License
Apache-2.0

Strengths

  • Processes speech as audio arrives. Use its streaming API for continuous transcription.
  • Adapts vocabulary with supported models. Choose a dynamic-vocabulary model to restrict recognized phrases.

Limitations

  • Vocabulary changes depend on model. Choose a dynamic-graph model when runtime vocabulary changes matter.

Quickstart

From test_simple.py
$ pip install vosk
import wave
from vosk import Model, KaldiRecognizer

model = Model(lang="en-us")
with wave.open("speech.wav", "rb") as wav:
    assert wav.getnchannels() == 1 and wav.getsampwidth() == 2
    recognizer = KaldiRecognizer(model, wav.getframerate())
    recognizer.AcceptWaveform(wav.readframes(wav.getnframes()))
print(recognizer.FinalResult())

Vosk examples

From open-source projects on GitHub

FAQ

faster-whisper suits local Whisper transcription with batched inference and word timestamps. Vosk suits offline streaming recognition. SpeechRecognition suits code that switches between hosted services and offline engines through one interface.

faster-whisper runs Whisper speech recognition on a separate inference engine, with batched inference and optional word timestamps. Its segments are a generator. Transcription starts when the code iterates over them.

SpeechBrain is a PyTorch speech toolkit for pretrained inference and custom speech recognition training.

Only with a separate offline engine. Engines such as Vosk must be installed on their own.

sherpa-onnx is a local ONNX speech toolkit with separate streaming and offline recognizers.

For coding agents

Found your speech recognition library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official