sola for mmvcv15
This commit is contained in:
parent
e3385b8804
commit
74a8674b63
@ -147,6 +147,10 @@
|
||||
{
|
||||
"name": "trancateNumThreshold",
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"name": "solaEnable",
|
||||
"options": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -147,6 +147,10 @@
|
||||
{
|
||||
"name": "trancateNumThreshold",
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"name": "solaEnable",
|
||||
"options": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -166,7 +166,7 @@ class MMVCv15:
|
||||
spec = torch.squeeze(spec, 0)
|
||||
return spec
|
||||
|
||||
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"):
|
||||
@ -174,7 +174,11 @@ class MMVCv15:
|
||||
else:
|
||||
self.audio_buffer = newData
|
||||
|
||||
convertSize = inputSize + crossfadeSize
|
||||
if solaEnabled:
|
||||
convertSize = inputSize + crossfadeSize + solaSearchFrame
|
||||
else:
|
||||
convertSize = inputSize + crossfadeSize
|
||||
|
||||
if convertSize < 8192:
|
||||
convertSize = 8192
|
||||
if convertSize % self.hps.data.hop_length != 0: # モデルの出力のホップサイズで切り捨てが発生するので補う。
|
||||
|
@ -208,7 +208,7 @@ class VoiceChanger():
|
||||
|
||||
# receivedData: tuple of short
|
||||
def on_request(self, receivedData: AudioInOut) -> tuple[AudioInOut, list[Union[int, float]]]:
|
||||
if self.settings.solaEnabled and (self.modelType == "RVC" or self.modelType == "MMVCv13"):
|
||||
if self.settings.solaEnabled and (self.modelType == "RVC" or self.modelType == "MMVCv13" or self.modelType == "MMVCv15"):
|
||||
return self.on_request_sola(receivedData)
|
||||
else:
|
||||
return self.on_request_legacy(receivedData)
|
||||
@ -399,6 +399,7 @@ class VoiceChanger():
|
||||
def export2onnx(self):
|
||||
return self.voiceChanger.export2onnx()
|
||||
|
||||
|
||||
##############
|
||||
PRINT_CONVERT_PROCESSING: bool = False
|
||||
# PRINT_CONVERT_PROCESSING = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user