File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -979,21 +979,15 @@ def audio_callback(
979979 self .input_wav [- indata .shape [0 ] :] = torch .from_numpy (indata ).to (
980980 self .config .device
981981 )
982- # self.input_wav_res[: -self.block_frame_16k] = self.input_wav_res[
983- # self.block_frame_16k :
984- # ].clone()
985- # self.input_wav_res[-320 * (indata.shape[0] // self.zc + 1) :] = (
986- # self.resampler(self.input_wav[-indata.shape[0] - 2 * self.zc :])[
987- # 320:
988- # ]
989- # )
990- self .input_wav_res = torch .from_numpy (
991- librosa .resample (
992- self .input_wav .cpu ().numpy (),
993- orig_sr = self .gui_config .samplerate ,
994- target_sr = 16000
995- )
996- ).to (self .config .device )
982+ self .input_wav_res [: - self .block_frame_16k ] = self .input_wav_res [
983+ self .block_frame_16k :
984+ ].clone ()
985+ self .input_wav_res [- 320 * (indata .shape [0 ] // self .zc + 1 ) :] = (
986+ # self.resampler(self.input_wav[-indata.shape[0] - 2 * self.zc :])[
987+ # 320:
988+ # ]
989+ torch .from_numpy (librosa .resample (self .input_wav [- indata .shape [0 ] - 2 * self .zc :].cpu ().numpy (), orig_sr = self .gui_config .samplerate , target_sr = 16000 )[320 :])
990+ )
997991 print (f"preprocess time: { time .perf_counter () - start_time :.2f} " )
998992 # infer
999993 if self .function == "vc" :
You can’t perform that action at this time.
0 commit comments