openGPTSoVITSV3Model method

void openGPTSoVITSV3Model(
  1. String encoder,
  2. String decoder1,
  3. String decoder2,
  4. String ssl,
  5. String vq,
  6. String cfm,
  7. String bigvgan,
  8. String? chineseBert,
  9. String? vocab,
  10. int envId,
)

Opens a GPT-SoVITS V3 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. vq is the path to the VQ model file. cfm is the path to the CFM model file. bigvgan is the path to the BigVGAN 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 openGPTSoVITSV3Model(
  String encoder,
  String decoder1,
  String decoder2,
  String ssl,
  String vq,
  String cfm,
  String bigvgan,
  String? chineseBert,
  String? vocab,
  int envId,
) {
  _create(envId);

  int status;
  if (Platform.isWindows){
    status = ailiaVoice.ailiaVoiceOpenGPTSoVITSV3ModelFileW(
      ppAilia!.value,
      encoder.toNativeUtf16().cast<ffi.WChar>(),
      decoder1.toNativeUtf16().cast<ffi.WChar>(),
      decoder2.toNativeUtf16().cast<ffi.WChar>(),
      ssl.toNativeUtf16().cast<ffi.WChar>(),
      vq.toNativeUtf16().cast<ffi.WChar>(),
      cfm.toNativeUtf16().cast<ffi.WChar>(),
      bigvgan.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.ailiaVoiceOpenGPTSoVITSV3ModelFileA(
      ppAilia!.value,
      encoder.toNativeUtf8().cast<ffi.Char>(),
      decoder1.toNativeUtf8().cast<ffi.Char>(),
      decoder2.toNativeUtf8().cast<ffi.Char>(),
      ssl.toNativeUtf8().cast<ffi.Char>(),
      vq.toNativeUtf8().cast<ffi.Char>(),
      cfm.toNativeUtf8().cast<ffi.Char>(),
      bigvgan.toNativeUtf8().cast<ffi.Char>(),
      (chineseBert != null) ? chineseBert.toNativeUtf8().cast<ffi.Char>() : ffi.nullptr,
      (vocab != null) ? vocab.toNativeUtf8().cast<ffi.Char>() : ffi.nullptr,
    );
  }
  throwError("ailiaVoiceOpenGPTSoVITSV3ModelFile", status);

  _finalizeOpen();
}