Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

RealtimeSTT

> 编程语言
Open source

A robust, efficient, low-latency speech-to-text library with advanced voice activity detection, wake word activation and instant transcription.

10.0K stars0 likes1 views
WebsiteGitHub

About

A robust, efficient, low-latency speech-to-text library with advanced voice activity detection, wake word activation and instant transcription.

RealtimeSTT

RealtimeSTT is a Python speech-to-text library for applications that need voice activity detection, fast transcription, optional realtime text updates, wake words, and direct access to audio streams. It is designed for assistants, dictation tools, browser streaming servers, and prototypes that need to turn speech into text with only a few lines of code.

The general-purpose default path uses faster_whisper. Other engines are available through install extras when their optional dependencies and models are present.

Recommended Engine Profiles

  • CUDA / GPU: Keep using the established faster_whisper CUDA setup. It remains the recommended general-purpose GPU path.
  • CPU: For production streaming on Linux x86-64, the strongly recommended profile is sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8 for fast, replaceable realtime text together with sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8 for the single authoritative final transcript. Nemotron processes only new audio frames during the turn; Parakeet then refines the complete turn once at finalization. This pairing provides substantially better CPU streaming behavior than repeatedly retranscribing a growing audio buffer while preserving a high-quality final.

Install the CPU server stack and both pinned model bundles with:

bash
python -m pip install "RealtimeSTT[server,sherpa-onnx]"
stt-install-sherpa-models --root ./models/sherpa-onnx --model all

See the production server guide for the authenticated HTTP/WebSocket deployment recipe and exact pinned model directories.

Support RealtimeSTT

If RealtimeSTT saved you time, one GitHub star is a simple way to help make it more stable.

Stars improve visibility and visibility brings more users, more real-world testing, more bug reports, more fixes, and better releases for everyone.

Demo

https://github.com/user-attachments/assets/797e6552-27cd-41b1-a7f3-e5cbc72094f5

CLI demo code (reproduces the video above)

Featured Integration: Kroko/Banafo ASR

RealtimeSTT includes native support for kroko_onnx, the local streaming ASR engine from the Kroko/Banafo team.

This integration has been on my wishlist for a long time. Kroko is a strong fit for RealtimeSTT's goals: fast, accurate local speech recognition.

Start with the public Community models for local testing, or see Kroko/Banafo's commercial model options if you need production licensing and higher-end models.

bash
pip install "RealtimeSTT[kroko-builder,silero-onnx-cpu]"
stt-install-kroko --build

The silero-onnx-cpu extra gives AudioToTextRecorder a local VAD backend for recorder-based smoke tests and live microphone use.

See the Kroko-ONNX engine guide, Kroko ASR docs, and kroko-onnx on GitHub.

Install

The current CI matrix covers Python 3.11 and 3.12. Python 3.13 and newer are not release targets until dependency and CI gates are available.

bash
pip install "RealtimeSTT[faster-whisper]"

On Linux, install PortAudio headers before installing the package:

bash
sudo apt-get update
sudo apt-get install python3-dev portaudio19-dev

On macOS:

bash
brew install portaudio

For CUDA, platform notes, and optional engine stacks, see docs/installation.md.

Microphone Example

This waits for speech, stops after the detected utterance, and prints the final transcript:

python
from RealtimeSTT import AudioToTextRecorder

if __name__ == "__main__":
    with AudioToTextRecorder() as recorder:
        print("Speak now")
        print(recorder.text())

Use the if __name__ == "__main__": guard when running scripts, especially on Windows, because RealtimeSTT uses multiprocessing for model work.

Automatic Recording Loop

For continuous dictation, pass a callback to text() so transcription work can complete asynchronously while your loop keeps listening:

python
from RealtimeSTT import AudioToTextRecorder

def process_text(text):
    print(text)

if __name__ == "__main__":
    recorder = AudioToTextRecorder()

    while True:
        recorder.text(process_text)

External Audio

Set use_microphone=False when audio comes from a file, stream, websocket, or another process. Feed 16-bit mono PCM chunks at 16 kHz, or pass the original sample rate so RealtimeSTT can resample:

python
from RealtimeSTT import AudioToTextRecorder

if __name__ == "__main__":
    recorder = AudioToTextRecorder(use_microphone=False)

    with open("audio_chunk.pcm", "rb") as audio_file:
        recorder.feed_audio(audio_file.read(), original_sample_rate=16000)

    print(recorder.text())
    recorder.shutdown()

More examples are in docs/quick-start.md and docs/external-audio.md.

Configuration Reference

Every AudioToTextRecorder constructor parameter is documented in docs/configuration.md, including model/engine selection, realtime transcription, VAD timing, wake words, callbacks, external audio, logging, and executor injection.

Features

  • Voice activity detection with WebRTC VAD and Silero VAD.
  • Final and realtime transcription with selectable engines.
  • Optional wake word activation through Porcupine or OpenWakeWord.
  • Direct microphone input or application-fed audio chunks.
  • Event callbacks for recording, VAD, realtime text, transcription, and wake word state.
  • A packaged production FastAPI server with versioned HTTP/WebSocket contracts, session isolation, bounded shared inference resources, authentication, and readiness/capabilities endpoints.
  • A browser streaming reference app for source checkouts.

Documentation

  • Quick start: shortest demos and common recording patterns.
  • Installation: platform setup, CUDA notes, and optional dependencies.
  • Configuration: complete AudioToTextRecorder parameter reference.
  • Transcription engines: engine selection and setup links.
  • Custom transcription engines: public base class, executor integration, streaming sessions, and contribution guide.
  • Wake words: Porcupine and OpenWakeWord setup.
  • External audio: feeding audio without a microphone.
  • Testing: maintained unit and opt-in golden test workflow.
  • Test scripts: demos, manual tests, regressions, and legacy experiments under tests/.
  • FastAPI server: browser server configuration, protocol, metrics, and deployment notes.
  • Production server: packaged remote HTTP/WebSocket API, authentication, limits, and deployment recipe.
  • Troubleshooting: common install, audio, CUDA, model, dependency, and runtime errors.
  • Engine licenses: license notes for optional engine runtimes and model families.

Engine-specific references:

  • faster-whisper
  • whisper.cpp
  • OpenAI Whisper
  • Moonshine
  • sherpa-onnx
  • Kroko-ONNX
  • Parakeet NeMo
  • Meta Omnilingual ASR
  • Granite/Qwen Transformers engines
  • Cohere Transcribe
  • FunASR

Production Server

The supported remote server is packaged as an optional install. It binds to loopback by default and exposes versioned health, readiness, capabilities, raw-PCM final transcription, and ordered streaming WebSocket endpoints. Direct non-loopback binds require both a bearer token and Uvicorn TLS certificate/key files; for a reverse-proxy deployment, keep the server on loopback and terminate TLS at the proxy.

bash
python -m pip install "RealtimeSTT[server,faster-whisper]"
stt-server-production --host 127.0.0.1 --port 8010

For CPU INT8 deployment, the recommended pairing is sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8 for live hypotheses and sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8 for authoritative final transcription. Install RealtimeSTT[server,sherpa-onnx] and both pinned model bundles into persistent storage before following the server recipe. The server extra includes the local Silero ONNX VAD runtime used by legacy recorder-backed server paths. The versioned production WebSocket path owns its turn state and does not derive finalization from recorder VAD, so production startup does not need an interactive Torch Hub download:

bash
stt-install-sherpa-models --root ./models/sherpa-onnx --model all

See PRODUCTION_SERVER.md.

The interactive browser reference app remains in example_fastapi_server for source checkouts. See docs/fastapi-server.md for its UI, engine recipes, protocol details, and metrics.

Contributing

Focused tests and small changes are easiest to review. The project keeps fast unit tests separate from opt-in real-model tests; see docs/testing.md.

License

MIT

Author

Kolja Beigel

Issues· 148 open

View all issuesOpen on GitHub
  • #321

    RealtimeSTT Desktop App – Chinese UI, Drag & Drop, Fully Local & Free

    Updated Sep 19, 2026
  • #311

    Feature: Add FunASR/SenseVoice as alternative STT engine

    Updated Sep 13, 2026
  • #297

    openwakeword silent API incompatibility on Python 3.13+ and documentation issues

    Updated Jul 22, 2026
  • #50

    Launches but does not display any text

    Updated Jul 11, 2026
  • #197

    ModuleNotFoundError: No module named 'RealtimeSTT'

    Updated Jul 11, 2026
  • #320

    我做了个 RealtimeSTT 桌面版——中文界面、拖拽文件转文字、一键安装

    Updated Jul 9, 2026
  • #319

    Base class for self-implementation of RealtimeSTT

    Updated Jul 4, 2026
  • #300

    Request: Custom/Removeable "Speak Now" message.

    Updated Jun 17, 2026
  • #288

    Realtime translation possible?

    Updated May 31, 2026
  • #306

    Model and compatibility issues

    Updated May 22, 2026

> Tags

Pythonpythonrealtimespeech-to-text

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言