torchwrench.extras.audio module¶
- torchwrench.extras.audio.AudioMetaData¶
alias of
_AudioMetaData
- torchwrench.extras.audio.audio_metadata_to_dict(meta: _AudioMetaData) AudioMetaDataDict[source]¶
-
torchwrench.extras.audio.dump_audio(src: Tensor, uri: BinaryIO | str | Path | PathLike | None, sample_rate: int, channels_first: bool =
True, format: str | None =None, encoding: str | None =None, bits_per_sample: int | None =None, buffer_size: int =4096, backend: str | None =None, compression: CodecConfig | float | int | None =None, *, overwrite: bool =True, make_parents: bool =True) bytes[source]¶ Dump tensors to audio waveform file. Requires torchaudio package installed.
-
torchwrench.extras.audio.dump_with_torchaudio(src: Tensor, uri: BinaryIO | str | Path | PathLike | None, sample_rate: int, channels_first: bool =
True, format: str | None =None, encoding: str | None =None, bits_per_sample: int | None =None, buffer_size: int =4096, backend: str | None =None, compression: CodecConfig | float | int | None =None, *, overwrite: bool =True, make_parents: bool =True) bytes[source]¶ Dump tensors to audio waveform file. Requires torchaudio package installed.
- torchwrench.extras.audio.info_audio(uri: BinaryIO | str | PathLike | Path, **kwargs) _AudioMetaData[source]¶
-
torchwrench.extras.audio.load_audio(uri: BinaryIO | str | PathLike | Path, frame_offset: int =
0, num_frames: int =-1, normalize: bool =True, channels_first: bool =True, format: str | None =None, buffer_size: int =4096, backend: str | None =None) tuple[Tensor, int][source]¶
-
torchwrench.extras.audio.load_with_torchaudio(uri: BinaryIO | str | PathLike | Path, frame_offset: int =
0, num_frames: int =-1, normalize: bool =True, channels_first: bool =True, format: str | None =None, buffer_size: int =4096, backend: str | None =None) tuple[Tensor, int][source]¶
-
torchwrench.extras.audio.save_audio(src: Tensor, uri: BinaryIO | str | Path | PathLike | None, sample_rate: int, channels_first: bool =
True, format: str | None =None, encoding: str | None =None, bits_per_sample: int | None =None, buffer_size: int =4096, backend: str | None =None, compression: CodecConfig | float | int | None =None, *, overwrite: bool =True, make_parents: bool =True) bytes[source]¶ Dump tensors to audio waveform file. Requires torchaudio package installed.