diff --git a/client/demo/dist/assets/gui_settings/so-vits-svc-40.json b/client/demo/dist/assets/gui_settings/so-vits-svc-40.json index 2d77e628..16807a37 100644 --- a/client/demo/dist/assets/gui_settings/so-vits-svc-40.json +++ b/client/demo/dist/assets/gui_settings/so-vits-svc-40.json @@ -157,6 +157,10 @@ { "name": "trancateNumThreshold", "options": {} + }, + { + "name": "solaEnable", + "options": {} } ] }, diff --git a/client/demo/dist/assets/gui_settings/so-vits-svc-40v2.json b/client/demo/dist/assets/gui_settings/so-vits-svc-40v2.json index bc2a5bcf..9ed03c30 100644 --- a/client/demo/dist/assets/gui_settings/so-vits-svc-40v2.json +++ b/client/demo/dist/assets/gui_settings/so-vits-svc-40v2.json @@ -157,6 +157,10 @@ { "name": "trancateNumThreshold", "options": {} + }, + { + "name": "solaEnable", + "options": {} } ] }, diff --git a/client/demo/public/assets/gui_settings/so-vits-svc-40.json b/client/demo/public/assets/gui_settings/so-vits-svc-40.json index 2d77e628..16807a37 100644 --- a/client/demo/public/assets/gui_settings/so-vits-svc-40.json +++ b/client/demo/public/assets/gui_settings/so-vits-svc-40.json @@ -157,6 +157,10 @@ { "name": "trancateNumThreshold", "options": {} + }, + { + "name": "solaEnable", + "options": {} } ] }, diff --git a/client/demo/public/assets/gui_settings/so-vits-svc-40v2.json b/client/demo/public/assets/gui_settings/so-vits-svc-40v2.json index bc2a5bcf..9ed03c30 100644 --- a/client/demo/public/assets/gui_settings/so-vits-svc-40v2.json +++ b/client/demo/public/assets/gui_settings/so-vits-svc-40v2.json @@ -157,6 +157,10 @@ { "name": "trancateNumThreshold", "options": {} + }, + { + "name": "solaEnable", + "options": {} } ] }, diff --git a/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py b/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py index 33639d9b..d86b44eb 100644 --- a/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py +++ b/server/voice_changer/SoVitsSvc40/SoVitsSvc40.py @@ -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):