RealtimeSttSession

A controllable realtime speech-to-text WebSocket session.

Sessions support one events collector. Close the session when audio capture ends.

Properties

Link copied to clipboard
abstract val events: Flow<RealtimeSttEvent>

A buffered, single-consumer stream of server events.

Functions

Link copied to clipboard
abstract suspend fun close()

Immediately closes the realtime session.

Link copied to clipboard
abstract suspend fun commit()

Commits the audio accumulated since the previous commit.

Link copied to clipboard
abstract suspend fun sendAudio(audio: ByteArray, commit: Boolean = false)

Sends a non-empty audio chunk encoded according to RealtimeSttOptions.audioFormat. When commit is true, the accumulated audio is committed after this chunk.