AudioLoader icon indicating copy to clipboard operation
AudioLoader copied to clipboard

`ext_audio` becomes redunant for MAPS and MAESTRO

Open KinWaiCheuk opened this issue 3 years ago • 0 comments

In the most updated version of AudioLoader, when sampling_rate=None, it loads .wav files. When sampling_rate!=None, it loads .flac files when they exist, otherwise it will downsample .wav files into .flac format and load the .flac. Please refer to the code snippet below:

if self.sampling_rate and (self.sampling_rate != 44100):
    # When sampling rate is given, it will automatically create a downsampled copy
    if self.downsample_exist('flac'):
        print(f"downsampled audio exists, skipping downsampling")
    else:
        print('doing resample()')
        self.resample(sampling_rate, 'flac', num_threads=4)
        
    for idx, audio in tqdm((enumerate(self._walker))):
        self._walker[idx] = audio.replace('.wav', '.flac')  

Therefore, ext_audio becomes useless. We can try to remove it without breaking the code.

KinWaiCheuk avatar Jun 29 '22 06:06 KinWaiCheuk