def preprocess(args, input_dir, out_dir, hparams): mel_dir = os.path.join(out_dir, 'mels') wav_dir = os.path.join(out_dir, 'audio') os.makedirs(mel_dir, exist_ok=True) os.makedirs(wav_dir, exist_ok=True) metadata = wavenet_preprocessor.build_from_path(hparams, input_dir, mel_dir, wav_dir, args.n_jobs, tqdm=tqdm) write_metadata(metadata, out_dir)
def preprocess(args, input_dir, out_dir, hparams): mel_dir = os.path.join(out_dir, 'mels') wav_dir = os.path.join(out_dir, 'audio') os.makedirs(mel_dir, exist_ok=True) os.makedirs(wav_dir, exist_ok=True) metadata = [] for folder in os.listdir(input_dir): if not folder.endswith('.tar.bz2'): print('preprocessing',folder,'...') in_dir = os.path.join(input_dir,folder+'/wav') speaker_id = hparams.speakers.index(folder.split('_')[2]) metadata+= build_from_path(hparams, in_dir, mel_dir, wav_dir,speaker_id, args.n_jobs, tqdm=tqdm) write_metadata(metadata, out_dir)