This commit is contained in:
Brandon Thomas
2023-05-18 23:31:13 -07:00
parent 7f60d4ca25
commit c1e9bcf0f0
2 changed files with 10 additions and 0 deletions
@@ -290,6 +290,7 @@ class Svc:
absolute_thresh: bool = False,
# fade_seconds: float = 0.0,
) -> np.ndarray[Any, np.dtype[np.float32]]:
LOG.info(f"infer_silence(): f0_method = {f0_method}")
sr = self.target_sample
result_audio = np.array([], dtype=np.float32)
chunk_length_min = chunk_length_min = (
@@ -38,6 +38,8 @@ def infer(
absolute_thresh: bool = False,
device: str | torch.device = get_optimal_device(),
):
LOG.info("infer()")
model_path = Path(model_path)
output_path = Path(output_path)
input_path = Path(input_path)
@@ -52,7 +54,12 @@ def infer(
device=device,
)
LOG.info("infer() librosa.load()")
audio, _ = librosa.load(input_path, sr=svc_model.target_sample)
LOG.info("infer() svc_model.infer_silence()")
audio = svc_model.infer_silence(
audio.astype(np.float32),
speaker=speaker,
@@ -67,6 +74,8 @@ def infer(
absolute_thresh=absolute_thresh,
)
LOG.info("infer() soundfile.write()")
soundfile.write(output_path, audio, svc_model.target_sample)