Shortcuts

Musan

class torchaudio.prototype.datasets.Musan(root: Union[str, Path], subset: str)[source]

DEPRECATED

Warning

This class is deprecated from version 2.8. It will be removed in the 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.

MUSAN [Snyder et al., 2015] dataset.

Args:

root (str or Path): Root directory where the dataset’s top-level directory exists. subset (str): Subset of the dataset to use. Options: ["music", "noise", "speech"].

__getitem__

Musan.__getitem__(n: int) Tuple[Tensor, int, str][source]

Return the n-th sample in the dataset.

Parameters

n (int) – Index of sample to be loaded.

Returns

torch.Tensor

Waveform.

int

Sample rate.

str

File name.

Return type

(torch.Tensor, int, str)

get_metadata

Musan.get_metadata(n: int) Tuple[str, int, str][source]

Get metadata for the n-th sample in the dataset. Returns filepath instead of waveform, but otherwise returns the same fields as __getitem__().

Parameters

n (int) – Index of sample to be loaded.

Returns

str

Path to audio.

int

Sample rate.

str

File name.

Return type

(str, int, str)

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources