An instance of a speech-to-text stream, as an asynchronous iterable iterator.
for await (const event of stream) { if (event.type === SpeechEventType.FINAL_TRANSCRIPT) { console.log(event.alternatives[0].text) }} Copy
for await (const event of stream) { if (event.type === SpeechEventType.FINAL_TRANSCRIPT) { console.log(event.alternatives[0].text) }}
This class is abstract, and as such cannot be used directly. Instead, use a provider plugin that exports its own child SpeechStream class, which inherits this class's methods.
Close both the input and output of the STT stream
Mark the input as ended and forbid additional pushes
Flush the STT, causing it to process all pending text
Push an audio frame to the STT
An instance of a speech-to-text stream, as an asynchronous iterable iterator.
Example: Looping through frames
Remarks
This class is abstract, and as such cannot be used directly. Instead, use a provider plugin that exports its own child SpeechStream class, which inherits this class's methods.