Skip to content

SpeechToText

Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:61

dispose(): void

Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:74

Frees the weights and every GPU buffer the runner holds.

void


stream(): AsyncIterable<SpeechStreamUpdate>

Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:68

Starts live transcription: feed samples with streamInsert, read the updates here. An update comes when the text changes; the iterator ends after streamStop or dispose. One stream at a time.

AsyncIterable<SpeechStreamUpdate>


streamInsert(samples): void

Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:70

Adds microphone samples, mono at 16 kHz, to the open stream.

Float32Array

void


streamStop(): void

Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:72

Commits what is left in the open stream and ends its iterator.

void


transcribe(audio): Promise<string>

Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:64

Mono samples at 16 kHz in, the spoken text out. Long clips are split on quiet moments. Clips shorter than one model frame give ”.

Float32Array

Promise<string>