TranscriptionEvent

sealed interface TranscriptionEvent(source)

Events emitted by a streaming speech-to-text engine (e.g. Flow<TranscriptionEvent>).

Inheritors

Types

Link copied to clipboard
data class CommittedSegment(val index: Int, val text: String, val startMs: Long, val endMs: Long) : TranscriptionEvent

A finalized segment. Committed segments are never revised.

Link copied to clipboard
data class Completed(val segmentCount: Int, val audioDurationMs: Long) : TranscriptionEvent

The stream finished successfully. This is the last event emitted.

Link copied to clipboard
data class Error(val exception: InferenceException) : TranscriptionEvent

A non-fatal or terminal error reported in-band. If terminal, no further events follow.

Link copied to clipboard
data class PartialHypothesis(val text: String, val startMs: Long, val endMs: Long) : TranscriptionEvent

An unstable hypothesis for audio that has not yet been committed. Later events may revise it.