Commit ef0981f9 authored by Quentin Aristote's avatar Quentin Aristote
Browse files

added option to ignore files

parent 4ea9f847
......@@ -41,7 +41,8 @@ def soundToSpectrogram(path, sample_rate = 16000, duration = 30) :
def getSpectrograms(dir_source, dir_target,
sample_rate = 16000,
overwrite = False,
duration = 30) :
duration = 30,
to_ignore = set()) :
r"""Compute the Mel spectrograms of all the sound files and write them to memory.
Args :
......@@ -49,7 +50,8 @@ def getSpectrograms(dir_source, dir_target,
dir_target (str) : the directory to save the the spectrograms to.
sample_rate (int, optional) : the sample rate in Hz to use when getting the spectrogram. Default : 16000 Hz
overwrite (bool, optional) : whether to compute all spectrograms again. Default : False
duration (int, optional) : the number of seconds the recording should last. Default : 30s"""
duration (int, optional) : the number of seconds the recording should last. Default : 30s
to_ignore (set, optional) : the set of titles of recordings that should not be downloaded."""
for filename in os.listdir(dir_source) :
title, _ = os.path.splitext(filename)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment