Configuration

May 30, 2026 ยท View on GitHub

AudioToTextRecorder is the main library entry point. This page is a parameter reference for its constructor. Examples and recommended starting patterns live in quick-start.md.

This page covers every public constructor parameter, grouped by purpose so the reference stays searchable without making the README too large.

from RealtimeSTT import AudioToTextRecorder

recorder = AudioToTextRecorder(
    model="small.en",
    language="en",
    enable_realtime_transcription=True,
)

Model And Engine Parameters

ParameterDefaultDescription
model"tiny"Main transcription model name or model path. Interpretation depends on transcription_engine.
transcription_engine"faster_whisper"Main transcription backend. See transcription-engines.md.
transcription_engine_optionsNoneEngine-specific dictionary passed only to the main backend.
download_rootNoneDirectory for model downloads or lookup. Behavior is engine-specific.
language""Language code. Empty string lets engines auto-detect when they support it. Some engines require a language.
compute_type"default"Numeric precision/quantization hint. For faster-whisper, see CTranslate2 quantization. Other engines map this where possible.
gpu_device_index0GPU id, or a list of GPU ids for compatible engines.
device"cuda"Device hint, usually "cuda" or "cpu". CPU-only engines ignore GPU settings.
batch_size16Main transcription batch size. Set 0 to disable batched faster-whisper inference.
beam_size5Main transcription beam size where supported.
initial_promptNoneString or token iterable passed to the main engine as prompt/context where supported.
suppress_tokens[-1]Token ids suppressed by Whisper-family engines where supported.
faster_whisper_vad_filterTrueEnables faster-whisper's own VAD filter during transcription in addition to recorder VAD.
normalize_audioFalseNormalizes audio peak before transcription in engine adapters that use the shared normalization helper.

Audio Input Parameters

ParameterDefaultDescription
input_device_indexNonePyAudio input device index. None lets PyAudio choose the default device.
use_microphoneTrueWhen False, audio must be supplied through feed_audio().
buffer_size512Recorder audio buffer size. Changing this can affect VAD behavior.
sample_rate16000Recorder sample rate. WebRTC VAD is sensitive to sample rate changes.
handle_buffer_overflowplatform-dependentLogs and drops overflowed microphone input. Defaults to True except on macOS.
allowed_latency_limit100Maximum unprocessed input chunks before old chunks may be discarded.
on_recorded_chunkNoneCallback receiving each recorded audio chunk.

Text Formatting And Lifecycle

ParameterDefaultDescription
ensure_sentence_starting_uppercaseTrueCapitalizes detected sentence starts.
ensure_sentence_ends_with_periodTrueAdds a final period when final text does not end in punctuation.
spinnerTrueShows the console state spinner.
levellogging.WARNINGLogger level used by the recorder.
debug_modeFalsePrints additional debug information.
print_transcription_timeFalseLogs main transcription processing time.
no_log_fileFalseSkips the debug log file.
use_extended_loggingFalseEnables more detailed recording worker logs.
start_callback_in_new_threadFalseRuns callbacks in new threads instead of the recorder thread.

Recording And VAD Parameters

ParameterDefaultDescription
silero_sensitivity0.4Silero VAD sensitivity, from 0 to 1.
silero_use_onnxFalseUses Silero's ONNX path instead of the PyTorch path.
silero_deactivity_detectionFalseUses Silero for end-of-speech detection instead of the default WebRTC end detection path.
deactivity_silence_confirmation_duration0.16Required continuous VAD silence before end-of-speech silence is confirmed.
webrtc_sensitivity3WebRTC VAD aggressiveness from 0 to 3; higher is more aggressive and less sensitive.
warmup_vadTrueRuns a small VAD warmup during initialization to avoid first-chunk lazy setup cost.
post_speech_silence_duration0.6Required silence after speech before a recording is considered complete.
min_length_of_recording0.5Minimum recording duration in seconds.
min_gap_between_recordings0Minimum gap in seconds between recordings.
pre_recording_buffer_duration1.0Amount of pre-roll audio to keep before detected speech.
early_transcription_on_silence0Starts an early final transcription after this many milliseconds of silence; the result is discarded if speech resumes.

Realtime Transcription Parameters

ParameterDefaultDescription
enable_realtime_transcriptionFalseEnables interim transcription while recording is still active.
use_main_model_for_realtimeFalseReuses the main model for realtime updates instead of loading a separate realtime model.
realtime_transcription_engineNoneRealtime backend. None uses transcription_engine.
realtime_transcription_engine_optionsNoneEngine-specific options for realtime. None reuses transcription_engine_options.
realtime_model_type"tiny"Realtime model name or path.
realtime_processing_pause0.2Seconds between realtime transcription attempts. Lower values increase load.
init_realtime_after_seconds0.2Initial delay after recording starts before the first realtime update.
realtime_batch_size16Realtime transcription batch size.
beam_size_realtime3Realtime beam size where supported.
initial_prompt_realtimeNonePrompt/context for the realtime model where supported.
realtime_transcription_use_syllable_boundariesFalseSchedules realtime updates from a lightweight acoustic boundary detector instead of only a fixed timer.
realtime_boundary_detector_sensitivity0.6Boundary detector sensitivity, from conservative 0 to eager 1.
realtime_boundary_followup_delays(0.05, 0.2)Extra realtime update delays after a detected boundary. None or empty disables follow-ups.

Wake Word Parameters

ParameterDefaultDescription
wakeword_backend""Wake word backend. Use "pvporcupine"/"pvp" or "oww"/"openwakeword".
wake_words""Comma-separated Porcupine keywords. Also enables wake word mode.
wake_words_sensitivity0.6Wake word sensitivity from 0 to 1.
wake_word_activation_delay0.0Delay before switching from normal voice activation to wake word activation.
wake_word_timeout5.0Seconds after wake word detection to wait for speech before returning to wake word mode.
wake_word_buffer_duration0.1Audio removed/buffered around wake word detection so the wake word is not included in the transcription.
openwakeword_model_pathsNoneComma-separated OpenWakeWord .onnx or .tflite model paths.
openwakeword_inference_framework"onnx"OpenWakeWord inference framework: "onnx" or "tflite".

Callback Parameters

All callbacks are optional. By default they run in the recorder flow; set start_callback_in_new_thread=True if callbacks may block.

ParameterCalled when
on_recording_startA recording starts.
on_recording_stopA recording stops.
on_transcription_startFinal transcription starts.
on_realtime_transcription_updateNew interim realtime text is available. Receives text.
on_realtime_transcription_stabilizedHigher-quality stabilized realtime text is available. Receives text.
on_realtime_text_stabilization_updateStructured realtime stabilization event is available.
on_vad_startVoice activity is detected.
on_vad_stopVoice activity ends.
on_vad_detect_startRecorder starts listening for voice activity.
on_vad_detect_stopRecorder stops listening for voice activity.
on_turn_detection_startTurn detection starts.
on_turn_detection_stopTurn detection stops.
on_wakeword_detectedWake word is detected.
on_wakeword_timeoutWake word was detected but no speech arrived before timeout.
on_wakeword_detection_startWake word listening starts.
on_wakeword_detection_endWake word listening stops.
on_recorded_chunkA raw recorded chunk is available. Receives bytes.

Executor Injection

ParameterDefaultDescription
transcription_executorNoneOptional callable used instead of the default main transcription execution path. Primarily used by tests and server integration.
realtime_transcription_executorNoneOptional callable used instead of the default realtime transcription execution path. Primarily used by tests and shared-model server integration.

External Audio API

When use_microphone=False, call:

recorder.feed_audio(chunk, original_sample_rate=16000)

chunk should be 16-bit mono PCM bytes. If original_sample_rate is not 16000, the recorder resamples before placing audio into its queue. More detail lives in external-audio.md.

Shutdown

Prefer the context manager:

with AudioToTextRecorder() as recorder:
    print(recorder.text())

If you do not use with, call:

recorder.shutdown()