From 2bd433317fec9a49c742eed4abb6a5284a36e79e Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 6 Dec 2023 14:05:56 +0800 Subject: [PATCH] Fix MFC --- .../NonStreamingTextToSpeechDlg.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mfc-examples/NonStreamingTextToSpeech/NonStreamingTextToSpeechDlg.cpp b/mfc-examples/NonStreamingTextToSpeech/NonStreamingTextToSpeechDlg.cpp index 5ad7fda4f..05a84199c 100644 --- a/mfc-examples/NonStreamingTextToSpeech/NonStreamingTextToSpeechDlg.cpp +++ b/mfc-examples/NonStreamingTextToSpeech/NonStreamingTextToSpeechDlg.cpp @@ -431,15 +431,12 @@ void CNonStreamingTextToSpeechDlg::Init() { ok = false; } - if (!Exists("./lexicon.txt") && !Exists("./espeak-ng-data/phontab")) { - error_message += "Cannot find espeak-ng-data directory or ./lexicon.txt\r\n"; - ok = false; - } - if (!Exists("./tokens.txt")) { error_message += "Cannot find ./tokens.txt\r\n"; ok = false; } + // it is OK to leave lexicon.txt and espeak-ng-data empty + // since models using characters don't need them if (!ok) { generate_btn_.EnableWindow(FALSE); @@ -470,7 +467,7 @@ void CNonStreamingTextToSpeechDlg::Init() { config.model.vits.model = "./model.onnx"; if (Exists("./espeak-ng-data/phontab")) { config.model.vits.data_dir = "./espeak-ng-data"; - } else { + } else if (Exists("./lexicon.txt")) { config.model.vits.lexicon = "./lexicon.txt"; } config.model.vits.tokens = "./tokens.txt";