Musan¶ class torchaudio.prototype.datasets.Musan(root: Union[str, Path], subset: str)[原始碼]¶ MUSAN [Snyder et al., 2015] 資料集。 參數: root (str 或 Path) – 資料集頂層目錄存在的根目錄。 subset (str) – 要使用的資料集子集。選項:["music", "noise", "speech"]。 __getitem__¶ Musan.__getitem__(n: int) → Tuple[Tensor, int, str][原始碼]¶ 傳回資料集中第 n 個樣本。 參數: n (int) – 要載入的樣本索引。 傳回: torch.Tensor波形。 int取樣率。 str檔案名稱。 回傳型別: (torch.Tensor, int, str) get_metadata¶ Musan.get_metadata(n: int) → Tuple[str, int, str][原始碼]¶ 取得資料集中第 n 個樣本的中繼資料。傳回檔案路徑而不是波形,但其他方面傳回與 __getitem__() 相同的欄位。 參數: n (int) – 要載入的樣本索引。 傳回: str音訊檔案路徑。 int取樣率。 str檔案名稱。 回傳型別: (str, int, str)