Musan¶ 類 torchaudio.prototype.datasets.Musan(root: Union[str, Path], subset: str)[source]¶ MUSAN [Snyder 等人,2015] 資料集。 引數: root (str 或 Path) – 資料集頂層目錄所在的根目錄。 subset (str) – 要使用的資料集子集。選項:["music", "noise", "speech"]。 __getitem__¶ Musan.__getitem__(n: int) → Tuple[Tensor, int, str][source]¶ 返回資料集中的第 n 個樣本。 引數: n (int) – 要載入樣本的索引。 返回: torch.Tensor波形。 int取樣率。 str檔名。 返回型別: (torch.Tensor, int, str) get_metadata¶ Musan.get_metadata(n: int) → Tuple[str, int, str][source]¶ 獲取資料集中第 n 個樣本的元資料。返回檔案路徑而不是波形,但其他欄位與 __getitem__() 返回的相同。 引數: n (int) – 要載入樣本的索引。 返回: str音訊路徑。 int取樣率。 str檔名。 返回型別: (str, int, str)