torchaudio¶
I/O functionalities¶
Audio I/O functions are implemented in torchaudio.backend module, but for the ease of use, the following functions are made available on torchaudio
module. There are different backends available and you can switch backends with set_audio_backend()
.
Please refer to torchaudio.backend for the detail, and the Audio I/O tutorial for the usage.
-
torchaudio.
info
(filepath: str, ...)¶ Fetch meta data of an audio file. Refer to torchaudio.backend for the detail.
-
torchaudio.
load
(filepath: str, ...)¶ Load audio file into torch.Tensor object. Refer to torchaudio.backend for the detail.
-
torchaudio.
save
(filepath: str, src: torch.Tensor, sample_rate: int, ...)¶ Save torch.Tensor object into an audio format. Refer to torchaudio.backend for the detail.
Backend Utilities¶
-
torchaudio.
list_audio_backends
() → List[str][source]¶ List available backends
- Returns
The list of available backends.
- Return type
List[str]