class

CrystalAudio::Transcription::Streamer

Inherits Reference < Object

Near-real-time transcription for dictation via chunked audio processing. Push PCM samples as they arrive; get Segment callbacks as text is recognized.

Constants

OVERLAP_MS = 500
OVERLAP_SAMPLES = (SAMPLE_RATE * OVERLAP_MS) // 1000
SAMPLE_RATE = 16000
STEP_MS = 3000
STEP_SAMPLES = (SAMPLE_RATE * STEP_MS) // 1000
WINDOW_MS = 5000
WINDOW_SAMPLES = (SAMPLE_RATE * WINDOW_MS) // 1000

Constructors

new(model_path : String, &callback : Segment -> )
Source

Instance methods

flush

Flush remaining audio

Source
push(samples : Slice(Float32))

Push new PCM samples (Float32, 16 kHz mono). Thread-safe via Mutex.

Source