mp.tasks.audio.TtsAudioResult
Stay organized with collections
Save and categorize content based on your preferences.
Synthesized audio chunk or full clip returned by TextToSpeech.
mp.tasks.audio.TtsAudioResult(
samples: np.ndarray,
sample_rate_hz: int,
chunk_index: int = 0,
is_final: bool = True,
word_timestamps: tuple[WordTimestamp, ...] = ()
)
Attributes |
samples
|
1D NumPy array of mono float32 PCM samples in [-1.0, 1.0].
|
sample_rate_hz
|
Output PCM sample rate in Hz.
|
chunk_index
|
Zero-based clause/chunk index in a streaming session.
|
is_final
|
Whether this chunk is the final output in the stream.
|
word_timestamps
|
Word-level timing alignments for read-along highlighting.
|
duration_seconds
|
Returns the duration of samples in seconds.
|
Methods
__eq__
__eq__(
other
)
Return self==value.
Class Variables |
|
chunk_index
|
0
|
|
is_final
|
True
|
|
word_timestamps
|
()
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-05 UTC.
[null,null,["Last updated 2026-11-05 UTC."],[],[]]