mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
sola for so-vits-svc40
This commit is contained in:
parent
74a8674b63
commit
bc09f90bd3
@ -157,6 +157,10 @@
|
||||
{
|
||||
"name": "trancateNumThreshold",
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"name": "solaEnable",
|
||||
"options": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -157,6 +157,10 @@
|
||||
{
|
||||
"name": "trancateNumThreshold",
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"name": "solaEnable",
|
||||
"options": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -157,6 +157,10 @@
|
||||
{
|
||||
"name": "trancateNumThreshold",
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"name": "solaEnable",
|
||||
"options": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -157,6 +157,10 @@
|
||||
{
|
||||
"name": "trancateNumThreshold",
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"name": "solaEnable",
|
||||
"options": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -252,7 +252,7 @@ class SoVitsSvc40:
|
||||
c = c.unsqueeze(0)
|
||||
return c, f0, uv
|
||||
|
||||
def generate_input(self, newData: any, inputSize: int, crossfadeSize: int):
|
||||
def generate_input(self, newData: any, inputSize: int, crossfadeSize: int, solaEnabled: bool = False, solaSearchFrame: int = 0):
|
||||
newData = newData.astype(np.float32) / self.hps.data.max_wav_value
|
||||
|
||||
if hasattr(self, "audio_buffer"):
|
||||
@ -260,7 +260,10 @@ class SoVitsSvc40:
|
||||
else:
|
||||
self.audio_buffer = newData
|
||||
|
||||
convertSize = inputSize + crossfadeSize + self.settings.extraConvertSize
|
||||
if solaEnabled:
|
||||
convertSize = inputSize + crossfadeSize + solaSearchFrame + self.settings.extraConvertSize
|
||||
else:
|
||||
convertSize = inputSize + crossfadeSize + self.settings.extraConvertSize
|
||||
|
||||
if convertSize % self.hps.data.hop_length != 0: # モデルの出力のホップサイズで切り捨てが発生するので補う。
|
||||
convertSize = convertSize + (self.hps.data.hop_length - (convertSize % self.hps.data.hop_length))
|
||||
@ -349,6 +352,7 @@ class SoVitsSvc40:
|
||||
audio = self._onnx_inference(data)
|
||||
else:
|
||||
audio = self._pyTorch_inference(data)
|
||||
|
||||
return audio
|
||||
|
||||
def __del__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user