mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-24 05:55:01 +03:00
hotfix: RVCquality=highの時のバグを修正
This commit is contained in:
parent
6e18b42c51
commit
81fe3cd6a0
@ -103,7 +103,8 @@ class Pipeline(object):
|
|||||||
|
|
||||||
# RVC QualityがOnのときにはsilence_frontをオフに。
|
# RVC QualityがOnのときにはsilence_frontをオフに。
|
||||||
silence_front = silence_front if repeat == 0 else 0
|
silence_front = silence_front if repeat == 0 else 0
|
||||||
pitchf = pitchf if repeat == 0 else torch.zeros([pitchf.shape[0], pitchf.shape[1] * 2])
|
pitchf = pitchf if repeat == 0 else np.zeros(p_len)
|
||||||
|
out_size = out_size if repeat == 0 else None
|
||||||
|
|
||||||
# ピッチ検出
|
# ピッチ検出
|
||||||
try:
|
try:
|
||||||
@ -116,8 +117,8 @@ class Pipeline(object):
|
|||||||
self.window,
|
self.window,
|
||||||
silence_front=silence_front,
|
silence_front=silence_front,
|
||||||
)
|
)
|
||||||
pitch = pitch[:p_len]
|
# pitch = pitch[:p_len]
|
||||||
pitchf = pitchf[:p_len]
|
# pitchf = pitchf[:p_len]
|
||||||
pitch = torch.tensor(pitch, device=self.device).unsqueeze(0).long()
|
pitch = torch.tensor(pitch, device=self.device).unsqueeze(0).long()
|
||||||
pitchf = torch.tensor(pitchf, device=self.device, dtype=torch.float).unsqueeze(0)
|
pitchf = torch.tensor(pitchf, device=self.device, dtype=torch.float).unsqueeze(0)
|
||||||
else:
|
else:
|
||||||
@ -209,6 +210,7 @@ class Pipeline(object):
|
|||||||
if type(self.inferencer) in [OnnxRVCInferencer, OnnxRVCInferencerNono]:
|
if type(self.inferencer) in [OnnxRVCInferencer, OnnxRVCInferencerNono]:
|
||||||
npyOffset = math.floor(silence_front * 16000) // 360
|
npyOffset = math.floor(silence_front * 16000) // 360
|
||||||
feats = feats[:, npyOffset * 2 :, :]
|
feats = feats[:, npyOffset * 2 :, :]
|
||||||
|
|
||||||
feats_len = feats.shape[1]
|
feats_len = feats.shape[1]
|
||||||
if pitch is not None and pitchf is not None:
|
if pitch is not None and pitchf is not None:
|
||||||
pitch = pitch[:, -feats_len:]
|
pitch = pitch[:, -feats_len:]
|
||||||
|
Loading…
Reference in New Issue
Block a user