- class torchaudio.io.play_audio(waveform: Tensor, sample_rate: Optional[float], device: Optional[str] = None)¶
Plays audio through specified or available output device.
This function is currently only supported on MacOS, and requires libavdevice (FFmpeg) with
This function can play up to two audio channels.
waveform – Tensor containing the audio to play. Expected shape: (time, num_channels).
sample_rate – Sample rate of the audio to play.
device – Output device to use. If None, the default device is used.