openGPTSoVITSV2Model method
Opens a GPT-SoVITS V2 model.
encoder is the path to the t2s_encoder model file.
decoder1 is the path to the t2s_fsdec model file.
decoder2 is the path to the t2s_sdec model file.
wave is the path to the VITS model file.
ssl is the path to the CNHuBERT SSL model file.
chineseBert is the path to the Chinese BERT model file (optional).
vocab is the path to the vocabulary file (optional).
envId is the execution environment ID.
Implementation
void openGPTSoVITSV2Model(
String encoder,
String decoder1,
String decoder2,
String wave,
String ssl,
String? chineseBert,
String? vocab,
int envId,
) {
_create(envId);
int status;
if (Platform.isWindows){
status = ailiaVoice.ailiaVoiceOpenGPTSoVITSV2ModelFileW(
ppAilia!.value,
encoder.toNativeUtf16().cast<ffi.WChar>(),
decoder1.toNativeUtf16().cast<ffi.WChar>(),
decoder2.toNativeUtf16().cast<ffi.WChar>(),
wave.toNativeUtf16().cast<ffi.WChar>(),
ssl.toNativeUtf16().cast<ffi.WChar>(),
(chineseBert != null) ? chineseBert.toNativeUtf16().cast<ffi.WChar>() : ffi.nullptr,
(vocab != null) ? vocab.toNativeUtf16().cast<ffi.WChar>() : ffi.nullptr,
);
}else{
status = ailiaVoice.ailiaVoiceOpenGPTSoVITSV2ModelFileA(
ppAilia!.value,
encoder.toNativeUtf8().cast<ffi.Char>(),
decoder1.toNativeUtf8().cast<ffi.Char>(),
decoder2.toNativeUtf8().cast<ffi.Char>(),
wave.toNativeUtf8().cast<ffi.Char>(),
ssl.toNativeUtf8().cast<ffi.Char>(),
(chineseBert != null) ? chineseBert.toNativeUtf8().cast<ffi.Char>() : ffi.nullptr,
(vocab != null) ? vocab.toNativeUtf8().cast<ffi.Char>() : ffi.nullptr,
);
}
throwError("ailiaVoiceOpenGPTSoVITSV2ModelFile", status);
_finalizeOpen();
}