Skip to content

Interface: SttHandle

Defined in: stt.ts:41

Properties

transport

readonly transport: SttTransport

Defined in: stt.ts:43

The transport's advertised surface (word timestamps, keyterms, …).

Methods

appendAudio()

appendAudio(bytes): void

Defined in: stt.ts:58

Feed one PCM16 frame to the open segment (the no-AudioSource path).

Parameters

bytes

Uint8Array

Returns

void


beginSegment()

beginSegment(): number

Defined in: stt.ts:52

Begin a push-to-talk segment; returns its ordinal. Auto-connects.

Returns

number


cancelSegment()

cancelSegment(): void

Defined in: stt.ts:56

Drop the open segment (an accidental tap) without transcribing it.

Returns

void


close()

close(): void

Defined in: stt.ts:63

Close the session and stop the audio source.

Returns

void


connect()

connect(): Promise<void>

Defined in: stt.ts:50

Mint a credential and open the vendor session. Idempotent while a connection is live or in flight. Called implicitly by beginSegment, but calling it eagerly (at UI-arm time) overlaps the mint+handshake with the human's arm→talk gap — the channel's own pattern.

Returns

Promise<void>


drain()

drain(timeoutMs?): Promise<number[]>

Defined in: stt.ts:61

Resolve when every committed segment has finaled (or timeout, returning the ordinals still outstanding).

Parameters

timeoutMs?

number

Returns

Promise<number[]>


endSegment()

endSegment(): void

Defined in: stt.ts:54

Commit the open segment (talk-end): its audio becomes one transcript.

Returns

void


status()

status(): SttStatus

Defined in: stt.ts:64

Returns

SttStatus


subscribe()

subscribe(listener): () => void

Defined in: stt.ts:65

Parameters

listener

(event) => void

Returns

() => void