Skip to content

Interface: SttConnection

Defined in: types.ts:79

A live vendor session. The seam the channel proved against both engines: audio streams in by segment ordinal; results come back through the SttCallbacks handed to SttTransport.open.

Methods

appendAudio()

appendAudio(segment, bytes): void

Defined in: types.ts:81

Append one PCM16 frame of segment.

Parameters

segment

number

bytes

Uint8Array

Returns

void


close()

close(): void

Defined in: types.ts:98

Close the vendor socket (idempotent).

Returns

void


commit()

commit(segment): void

Defined in: types.ts:83

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

Parameters

segment

number

Returns

void


discard()

discard(segment): void

Defined in: types.ts:90

Drop segment without transcribing it — an accidental tap under the engine's commit floor. Stray frames must never prepend to the next segment's transcript (each engine resolves that its own wire-specific way; see the per-engine notes).

Parameters

segment

number

Returns

void


drain()

drain(timeoutMs): Promise<number[]>

Defined in: types.ts:96

Resolve once every committed-but-not-final segment has produced its final, or timeoutMs elapses — whichever first. Returns the ordinals still outstanding at timeout, so the caller can settle them loudly.

Parameters

timeoutMs

number

Returns

Promise<number[]>