Skip to content

Audio

Audio(
data_or_path: np.ndarray | str | os.PathLike[str],
caption: str = '',
sample_rate: int | None = None
) -> None

Wraps audio data for logging. Compatible with wandb.Audio interface.

Construction never raises for data-dependent problems — building media mid-training must not crash the job. Invalid inputs set invalid_reason instead (like Histogram), and Run.log() drops the item with a warning plus a run diagnostic.

Write audio data to a WAV file.