SpeechToText
Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:61
Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Defined in: packages/runntime/src/zoo/tasks/audio/speechToText.ts:74
Frees the weights and every GPU buffer the runner holds.
Returns
Section titled “Returns”void
stream()
Section titled “stream()”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.
Returns
Section titled “Returns”AsyncIterable<SpeechStreamUpdate>
streamInsert()
Section titled “streamInsert()”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.
Parameters
Section titled “Parameters”samples
Section titled “samples”Float32Array
Returns
Section titled “Returns”void
streamStop()
Section titled “streamStop()”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.
Returns
Section titled “Returns”void
transcribe()
Section titled “transcribe()”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 ”.
Parameters
Section titled “Parameters”Float32Array
Returns
Section titled “Returns”Promise<string>