<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/google-ai-edge/mediapipe/blob/master/mediapipe/tasks/python/audio/text_to_speech.py#L290-L323) |

Computes prosody- and waveform-aligned word timestamps via the C API.

```python
mp.tasks.audio.compute_word_timestamps(
    text: str,
    num_samples: int,
    sample_rate_hz: int,
    time_offset_sec: float = 0.0,
    samples: Optional[np.ndarray] = None
) -> tuple[`mp.tasks.audio.WordTimestamp`, ...]
```