speechbrain.augment.preparation module

Library for Downloading and Preparing Datasets for Data Augmentation, This library provides functions for downloading datasets from the web and preparing the necessary CSV data manifest files for use by data augmenters.

Authors: * Mirco Ravanelli 2023

Summary

Functions:

prepare_csv

Iterate a set of wavs and write the corresponding csv file.

prepare_dataset_from_URL

Downloads a dataset containing recordings (e.g., noise sequences) from the provided URL and prepares the necessary CSV files for use by the noise augmenter.

write_csv

Iterate through a list of audio files and write the corresponding CSV file.

Reference

speechbrain.augment.preparation.prepare_dataset_from_URL(URL, dest_folder, ext, csv_file, max_length=None)[source]

Downloads a dataset containing recordings (e.g., noise sequences) from the provided URL and prepares the necessary CSV files for use by the noise augmenter.

Parameters:
  • URL (str) – The URL of the dataset to download.

  • dest_folder (str) – The local folder where the noisy dataset will be downloaded.

  • ext (str) – File extensions to search for within the downloaded dataset.

  • csv_file (str) – The path to store the prepared noise CSV file.

  • max_length (float) – The maximum length in seconds. Recordings longer than this will be automatically cut into pieces.

speechbrain.augment.preparation.prepare_csv(filelist, csv_file, max_length=None)[source]

Iterate a set of wavs and write the corresponding csv file.

Parameters:
  • filelist (str) – A list containing the paths of files of interest.

  • csv_file (str) – The path to store the prepared noise CSV file.

  • max_length (float) – The maximum length in seconds. Recordings longer than this will be automatically cut into pieces.

speechbrain.augment.preparation.write_csv(filelist, csv_file, max_length=None)[source]

Iterate through a list of audio files and write the corresponding CSV file.

Parameters:
  • filelist (list of str) – A list containing the paths of audio files of interest.

  • csv_file (str) – The path where to store the prepared noise CSV file.

  • (optional) (max_lengthL float) – The maximum recording length in seconds. Recordings longer than this will be automatically cut into pieces.