TranscriptionStream
classin packageklyn.genai.stt
public class TranscriptionStream extends Generator<TranscriptionUpdate>
└ TranscriptionStream

Owned, single-consumer stream of revisable/final hypotheses. Whisper uses bounded audio windows with VAD, not native incremental decoding. cancel() is cross-thread; close()/read()/iteration belong to the consumer. A for-loop closes the stream on break. Closing stops, but does not close, its borrowed microphone; the caller owns that device.

Example

try updates = recognizer.stream(microphone, language="fr"): for update in updates: if update.isFinal: print(update.text)

Properties
Modifier and Type Member Description
public override readonly property current Last successful iteration value.
public readonly property isFinished
isFinished as Boolean
True when the consumer observed EOF or closed the stream.
Inherited Properties
propertyInherited Properties from Generator: current
Constructors
Modifier and Type Member Description
public TranscriptionStream
TranscriptionStream(task as RecognitionTask, queue as RecognitionQueue, control as RecognitionControl, microphone as Microphone)
Constructs a stream for a registered task; use SpeechRecognizer.stream().
Methods
Modifier and Type Member Description
public cancel
cancel() as Void
Stops capture and discards unfinished hypotheses, waking both ends.
public override close
close() as Void
Cancels, joins and releases the worker, even when stopping the borrowed microphone raises an error.
public override next
next() as Boolean
Advances the generator.
public read Waits for an update; null means EOF/cancellation.
Inherited Methods
methodInherited Methods from Generator: close, next