LIBRISPEECH¶ class torchaudio.datasets.LIBRISPEECH(root: Union[str, Path], url: str = 'train-clean-100', folder_in_archive: str = 'LibriSpeech', download: bool = False)[源码]¶ LibriSpeech [Panayotov 等人, 2015] 数据集。 参数: root (str or Path) – 数据集所在或将要下载到的目录路径。 url (str, optional) – 下载数据集的 URL,或要下载的数据集的类型。允许的类型值为 "dev-clean", "dev-other", "test-clean", "test-other", "train-clean-100", "train-clean-360" 和 "train-other-500"。(默认值: "train-clean-100") folder_in_archive (str, optional) – 数据集的顶层目录。(默认值: "LibriSpeech") download (bool, optional) – 如果在根路径未找到数据集,是否下载。(默认值: False)。 __getitem__¶ LIBRISPEECH.__getitem__(n: int) → Tuple[Tensor, int, str, int, int, int][源码]¶ 从数据集中加载第 n 个样本。 参数: n (int) – 要加载样本的索引 返回: 包含以下元素的元组; Tensor波形 int采样率 str转录文本 int发言人 ID int章 ID int话语 ID get_metadata¶ LIBRISPEECH.get_metadata(n: int) → Tuple[str, int, str, int, int, int][源码]¶ 获取数据集中第 n 个样本的元数据。返回文件路径而非波形,但其他字段与 __getitem__() 返回的相同。 参数: n (int) – 要加载样本的索引 返回: 包含以下元素的元组; str音频路径 int采样率 str转录文本 int发言人 ID int章 ID int话语 ID