openGPTSoVITSV2ProModel method
Opens a GPT-SoVITS V2Pro 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.
ssl is the path to the CNHuBERT SSL model file.
vits is the path to the VITS model file.
sv is the path to the speaker verification 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 openGPTSoVITSV2ProModel(
String encoder,
String decoder1,
String decoder2,
String ssl,
String vits,
String sv,
String? chineseBert,
String? vocab,
int envId,
) {
_create(envId);
int status;
if (Platform.isWindows){
status = ailiaVoice.ailiaVoiceOpenGPTSoVITSV2ProModelFileW(
ppAilia!.value,
encoder.toNativeUtf16().cast<ffi.WChar>(),
decoder1.toNativeUtf16().cast<ffi.WChar>(),
decoder2.toNativeUtf16().cast<ffi.WChar>(),
ssl.toNativeUtf16().cast<ffi.WChar>(),
vits.toNativeUtf16().cast<ffi.WChar>(),
sv.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.ailiaVoiceOpenGPTSoVITSV2ProModelFileA(
ppAilia!.value,
encoder.toNativeUtf8().cast<ffi.Char>(),
decoder1.toNativeUtf8().cast<ffi.Char>(),
decoder2.toNativeUtf8().cast<ffi.Char>(),
ssl.toNativeUtf8().cast<ffi.Char>(),
vits.toNativeUtf8().cast<ffi.Char>(),
sv.toNativeUtf8().cast<ffi.Char>(),
(chineseBert != null) ? chineseBert.toNativeUtf8().cast<ffi.Char>() : ffi.nullptr,
(vocab != null) ? vocab.toNativeUtf8().cast<ffi.Char>() : ffi.nullptr,
);
}
throwError("ailiaVoiceOpenGPTSoVITSV2ProModelFile", status);
_finalizeOpen();
}