def load_audio(self, audio_folder_path, fs): audio_list = [] audio_filename_list = glob.glob(os.path.join(audio_folder_path, '*.wav')) for audio_filename in audio_filename_list: audio_file_path = os.path.join(audio_folder_path, audio_filename) audio = au.normalize(au.read_wav(audio_file_path, fs)[0]) audio_list.append(audio) return audio_list
def load_wavs(audio_folder, db_setup): audio_list = db_setup['source_audio'] rate = db_setup['fs'] wav_list = [] if audio_list == ['']: audio_list = glob.glob(os.path.join(audio_folder, '*.wav')) for audio_filename in audio_list: wav_path = os.path.join(audio_folder, audio_filename) wav = au.normalize(au.read_wav(wav_path, rate)[0]) wav_list.append(wav) return wav_list