MCPcopy Index your code
hub / github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI / start_vc

Method start_vc

gui_v1.py:544–646  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

542 return True
543
544 def start_vc(self):
545 torch.cuda.empty_cache()
546 self.flag_vc = True
547 self.rvc = rvc_for_realtime.RVC(
548 self.gui_config.pitch,
549 self.gui_config.pth_path,
550 self.gui_config.index_path,
551 self.gui_config.index_rate,
552 self.gui_config.n_cpu,
553 inp_q,
554 opt_q,
555 self.config,
556 self.rvc if hasattr(self, "rvc") else None,
557 )
558 self.gui_config.samplerate = self.rvc.tgt_sr
559 self.zc = self.rvc.tgt_sr // 100
560 self.block_frame = (
561 int(
562 np.round(
563 self.gui_config.block_time
564 * self.gui_config.samplerate
565 / self.zc
566 )
567 )
568 * self.zc
569 )
570 self.block_frame_16k = 160 * self.block_frame // self.zc
571 self.crossfade_frame = (
572 int(
573 np.round(
574 self.gui_config.crossfade_time
575 * self.gui_config.samplerate
576 / self.zc
577 )
578 )
579 * self.zc
580 )
581 self.sola_search_frame = self.zc
582 self.extra_frame = (
583 int(
584 np.round(
585 self.gui_config.extra_time
586 * self.gui_config.samplerate
587 / self.zc
588 )
589 )
590 * self.zc
591 )
592 self.input_wav: torch.Tensor = torch.zeros(
593 self.extra_frame
594 + self.crossfade_frame
595 + self.sola_search_frame
596 + self.block_frame,
597 device=self.config.device,
598 dtype=torch.float32,
599 )
600 self.input_wav_res: torch.Tensor = torch.zeros(
601 160 * self.input_wav.shape[0] // self.zc,

Callers 1

event_handlerMethod · 0.95

Calls 1

TorchGateClass · 0.90

Tested by

no test coverage detected