From 0910d9ac841a1990eb5a701c659590aca558781c Mon Sep 17 00:00:00 2001 From: shahules786 Date: Sat, 15 Oct 2022 12:23:51 +0530 Subject: [PATCH] fix dns loader --- enhancer/data/fileprocessor.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/enhancer/data/fileprocessor.py b/enhancer/data/fileprocessor.py index e718f15..5b099d4 100644 --- a/enhancer/data/fileprocessor.py +++ b/enhancer/data/fileprocessor.py @@ -62,25 +62,24 @@ class ProcessorFunctions: ] for clean_file in clean_filenames: noisy_filenames = glob.glob( - os.path.join(noisy_path, f"*_{clean_file}.wav") + os.path.join(noisy_path, f"*_{clean_file}") ) for noisy_file in noisy_filenames: - sr_clean, clean_file = wavfile.read( + sr_clean, clean_wav = wavfile.read( os.path.join(clean_path, clean_file) ) - sr_noisy, noisy_file = wavfile.read(noisy_file) - if (clean_file.shape[-1] == noisy_file.shape[-1]) and ( + sr_noisy, noisy_wav = wavfile.read(noisy_file) + if (clean_wav.shape[-1] == noisy_wav.shape[-1]) and ( sr_clean == sr_noisy ): matching_wavfiles.append( { "clean": os.path.join(clean_path, clean_file), "noisy": noisy_file, - "duration": clean_file.shape[-1] / sr_clean, + "duration": clean_wav.shape[-1] / sr_clean, } ) - return matching_wavfiles