1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-07 10:10:23 +08:00

optimize(rvc): gather residuals

This commit is contained in:
源文雨
2024-06-08 00:44:46 +09:00
parent eb24434260
commit b91dcf2261
9 changed files with 210 additions and 200 deletions

View File

@@ -1,6 +1,7 @@
from typing import Any, Optional
import numpy as np
import pyworld
import typing
from .f0 import F0Predictor
@@ -10,7 +11,7 @@ class DioF0Predictor(F0Predictor):
super().__init__(hop_length, f0_min, f0_max, sampling_rate)
def compute_f0(
self, wav: np.ndarray[typing.Any, np.dtype], p_len: int | None = None
self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None
):
if p_len is None:
p_len = wav.shape[0] // self.hop_length
@@ -27,7 +28,7 @@ class DioF0Predictor(F0Predictor):
return self.__interpolate_f0(self.__resize_f0(f0, p_len))[0]
def compute_f0_uv(
self, wav: np.ndarray[typing.Any, np.dtype], p_len: int | None = None
self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None
):
if p_len is None:
p_len = wav.shape[0] // self.hop_length