diff --git a/requirements.txt b/requirements.txt index 99ddff5..7712dbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,5 +20,4 @@ tensorboard tensorboardX edge_tts pyyaml -pynvml -pyloudnorm \ No newline at end of file +pynvml \ No newline at end of file diff --git a/requirements_win.txt b/requirements_win.txt index 155a3d3..f14759a 100644 --- a/requirements_win.txt +++ b/requirements_win.txt @@ -23,5 +23,4 @@ onnxoptimizer tensorboardX edge_tts pyyaml -pynvml -pyloudnorm \ No newline at end of file +pynvml \ No newline at end of file diff --git a/resample.py b/resample.py index 70a5eb7..03e8891 100644 --- a/resample.py +++ b/resample.py @@ -5,7 +5,6 @@ import numpy as np from multiprocessing import Pool, cpu_count from scipy.io import wavfile from tqdm import tqdm -import pyloudnorm as pyln def process(item): @@ -22,20 +21,13 @@ def process(item): wav = 0.98 * wav / peak wav2 = librosa.resample(wav, orig_sr=sr, target_sr=args.sr2) wav2 /= max(wav2.max(), -wav2.min()) - try: - meter = pyln.Meter(args.sr2,block_size=0.2) - loudness = meter.integrated_loudness(wav2) - wav2 = pyln.normalize.loudness(wav2, loudness, -23.0) - # wav2 /= max(wav2.max(), -wav2.min()) - save_name = wav_name - save_path2 = os.path.join(args.out_dir2, speaker, save_name) - wavfile.write( - save_path2, - args.sr2, - (wav2 * np.iinfo(np.int16).max).astype(np.int16)) - except ValueError as e: - print(f"{wav_path} is too short(<200ms), the wav skip") - + save_name = wav_name + save_path2 = os.path.join(args.out_dir2, speaker, save_name) + wavfile.write( + save_path2, + args.sr2, + (wav2 * np.iinfo(np.int16).max).astype(np.int16) + ) if __name__ == "__main__":