An instance of a speech-to-text stream, as an asynchronous iterable iterator.

Example: Looping through frames

for await (const event of stream) {
if (event.type === SpeechEventType.FINAL_TRANSCRIPT) {
console.log(event.alternatives[0].text)
}
}

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.

Hierarchy (view full)

Constructors

Methods

  • Close both the input and output of the STT stream

    Returns void

  • Mark the input as ended and forbid additional pushes

    Returns void

  • Flush the STT, causing it to process all pending text

    Returns void

  • Push an audio frame to the STT

    Parameters

    • frame: AudioFrame

    Returns void