From d009111b3fc59f526b35aad0d48927ef1cf00c4a Mon Sep 17 00:00:00 2001 From: James Date: Tue, 12 Sep 2023 06:24:30 -0600 Subject: [PATCH] Do not adjust vc's sample rate, just return the target resampe rate when required. Fixes #1233 (#1234) --- infer/modules/vc/modules.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infer/modules/vc/modules.py b/infer/modules/vc/modules.py index 5beb28f..9b698e6 100644 --- a/infer/modules/vc/modules.py +++ b/infer/modules/vc/modules.py @@ -209,7 +209,9 @@ class VC: f0_file, ) if self.tgt_sr != resample_sr >= 16000: - self.tgt_sr = resample_sr + tgt_sr = resample_sr + else: + tgt_sr = self.tgt_sr index_info = ( "Index:\n%s." % file_index if os.path.exists(file_index) @@ -218,7 +220,7 @@ class VC: return ( "Success.\n%s\nTime:\nnpy: %.2fs, f0: %.2fs, infer: %.2fs." % (index_info, *times), - (self.tgt_sr, audio_opt), + (tgt_sr, audio_opt), ) except: info = traceback.format_exc()