Merge branch 'dev' of https://github.com/shahules786/enhancer into dev-hawk

This commit is contained in:
shahules786 2022-10-15 12:24:20 +05:30
commit 45b6fe0f3d
1 changed files with 5 additions and 6 deletions

View File

@ -62,25 +62,24 @@ class ProcessorFunctions:
] ]
for clean_file in clean_filenames: for clean_file in clean_filenames:
noisy_filenames = glob.glob( 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: 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) os.path.join(clean_path, clean_file)
) )
sr_noisy, noisy_file = wavfile.read(noisy_file) sr_noisy, noisy_wav = wavfile.read(noisy_file)
if (clean_file.shape[-1] == noisy_file.shape[-1]) and ( if (clean_wav.shape[-1] == noisy_wav.shape[-1]) and (
sr_clean == sr_noisy sr_clean == sr_noisy
): ):
matching_wavfiles.append( matching_wavfiles.append(
{ {
"clean": os.path.join(clean_path, clean_file), "clean": os.path.join(clean_path, clean_file),
"noisy": noisy_file, "noisy": noisy_file,
"duration": clean_file.shape[-1] / sr_clean, "duration": clean_wav.shape[-1] / sr_clean,
} }
) )
return matching_wavfiles return matching_wavfiles