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

Example: Looping through frames

for await (const event of stream) {
await source.captureFrame(event.frame);
}

Remarks

This class is abstract, and as such cannot be used directly. Instead, use a provider plugin that exports its own child SynthesizeStream class, which inherits this class's methods.

Hierarchy (view full)

Constructors

Properties

label: string = 'cartesia.SynthesizeStream'
END_OF_STREAM: typeof END_OF_STREAM

Methods

  • Close both the input and output of the TTS stream

    Returns void

  • Mark the input as ended and forbid additional pushes

    Returns void

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

    Returns void

  • Push a string of text to the TTS

    Parameters

    • text: string

    Returns void