selfclean_audio.datasets.utils#
Members
Quickly scan a directory for files with specified extensions. |
|
Resize a waveform tensor to the target length by trimming or padding. |
- selfclean_audio.datasets.utils.resize_waveform(waveform: Tensor, target_length: int)[source]#
Resize a waveform tensor to the target length by trimming or padding.
- Parameters:
waveform (torch.Tensor) – Input waveform tensor of shape (channels, length).
target_length (int) – Desired length of the output waveform.
- Returns:
Resized waveform tensor with the specified length.
- Return type:
- selfclean_audio.datasets.utils.fast_scandir(path: str, exts: list[str], recursive: bool = False)[source]#
Quickly scan a directory for files with specified extensions. From github.com/drscotthawley/aeiou/blob/main/aeiou/core.py
- Parameters:
- Returns:
A tuple containing a list of subfolder paths and a list of matched file paths.
- Return type: