TextToSpeechAudioChunk interface

A streaming chunk of synthesized PCM audio samples.

Signature:

export declare interface TextToSpeechAudioChunk 

Properties

Property Type Description
chunkIndex number Zero-based sequential index of this audio chunk in the stream.
isFinal boolean Whether this is the final chunk in the stream.
sampleRateHz number Sample rate of the audio samples in Hz.
samples Float32Array Synthesized mono PCM audio samples for this chunk in the range [-1.0, 1.0].
wordTimestamps WordTimestamp[] | undefined Estimated word-level timestamps for the words synthesized in this chunk.

TextToSpeechAudioChunk.chunkIndex

Zero-based sequential index of this audio chunk in the stream.

Signature:

chunkIndex: number;

TextToSpeechAudioChunk.isFinal

Whether this is the final chunk in the stream.

Signature:

isFinal: boolean;

TextToSpeechAudioChunk.sampleRateHz

Sample rate of the audio samples in Hz.

Signature:

sampleRateHz: number;

TextToSpeechAudioChunk.samples

Synthesized mono PCM audio samples for this chunk in the range [-1.0, 1.0].

Signature:

samples: Float32Array;

TextToSpeechAudioChunk.wordTimestamps

Estimated word-level timestamps for the words synthesized in this chunk.

Signature:

wordTimestamps?: WordTimestamp[];