From e4149f8d149a76afc3e44785e248030d3d749cfc Mon Sep 17 00:00:00 2001 From: prophesier <37784682+prophesier@users.noreply.github.com> Date: Wed, 30 Nov 2022 18:58:10 +0800 Subject: [PATCH] improve slience cut --- infer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/infer.py b/infer.py index 4d89734..7dc9c92 100644 --- a/infer.py +++ b/infer.py @@ -42,9 +42,7 @@ def run_clip(svc_model, key, acc, use_pe, use_crepe, thre, use_gt_mel, add_noise f0_tst = [] f0_pred = [] audio = [] - epsilon = 0.00002 for (slice_tag, data) in audio_data: - print(slice_tag, len(data)) print(f'#=====segment start, {round(len(data) / audio_sr, 3)}s======') length = int(np.ceil(len(data) / audio_sr * hparams['audio_sample_rate'])) raw_path = io.BytesIO() @@ -52,7 +50,7 @@ def run_clip(svc_model, key, acc, use_pe, use_crepe, thre, use_gt_mel, add_noise if hparams['debug']: print(np.mean(data), np.var(data)) raw_path.seek(0) - if np.var(data) < epsilon: + if slice_tag: print('jump empty segment') _f0_tst, _f0_pred, _audio = ( np.zeros(int(np.ceil(length / hparams['hop_size']))), np.zeros(int(np.ceil(length / hparams['hop_size']))),