klyn.genai.stt.SpeechRecognizer.stream
method
public stream(notnull microphone as Microphone, notnull language as String = "auto", minimumSpeechLevel as Double = 0.0003, partialResults as Boolean = true) as TranscriptionStream
Description

Starts one bounded, cancellable live transcription worker. Partial text replaces the same segmentId; final text commits it. Call microphone.stop() for a normal drain/final result; cancel() discards pending hypotheses. The microphone stays caller-owned and must outlive the stream.

Parameters
ParameterDescription
microphoneExplicitly opened mono 16 kHz capture source.
languageauto or a supported code.
minimumSpeechLevelFinite RMS floor in [0, 1], default 0.0003. Zero disables energy gating, allowing the model to decide whether quiet audio contains speech. The adaptive noise estimate starts at floor/3.
partialResultsEmit intermediate hypotheses, default true. False performs inference only at utterance boundaries/stop, without dropping PCM.
Returns

Owned single-consumer stream; close it before closing the microphone.

Throws
  • IOException if closed/busy; ValueException for unsupported language or an invalid minimum speech level.
Example

try microphone = Microphone.open(): try updates = speech.stream(microphone, "fr"): for update in updates: print(update.text)