From cb665e85673596cb2226e87246f432b58fd2bcce Mon Sep 17 00:00:00 2001 From: janvarev Date: Thu, 12 May 2022 15:34:16 +0300 Subject: [PATCH] =?UTF-8?q?5.4=20-=20=D0=BE=D0=BF=D1=86=D0=B8=D1=8F=20useT?= =?UTF-8?q?TSCache=20-=20ttsCache=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D0=B4=D1=83=D1=82=D1=81=D1=8F=20=D0=B2=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=BF=D0=B0=D0=BF=D0=BA=D1=83=20tts=5Fcache/?= =?UTF-8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/core.py | 4 ++++ vacore.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/core.py b/plugins/core.py index 1e23612..f6012b7 100644 --- a/plugins/core.py +++ b/plugins/core.py @@ -59,6 +59,10 @@ def start_with_options(core:VACore, manifest:dict): core.tts_cache_dir = "tts_cache" if not os.path.exists(core.tts_cache_dir): os.mkdir(core.tts_cache_dir) + if not os.path.exists(core.tts_cache_dir+"/"+core.ttsEngineId): + os.mkdir(core.tts_cache_dir+"/"+core.ttsEngineId) + + import lingua_franca lingua_franca.load_language(options["linguaFrancaLang"]) diff --git a/vacore.py b/vacore.py index f712655..2d242ee 100644 --- a/vacore.py +++ b/vacore.py @@ -7,7 +7,7 @@ from threading import Timer from jaa import JaaCore -version = "5.3" +version = "5.4" # main VACore class @@ -202,8 +202,8 @@ class VACore(JaaCore): def get_tts_cache_file(self, text_to_speech:str): hash = hashlib.md5(text_to_speech.encode('utf-8')).hexdigest() text_slice = text_to_speech[:40] - filename = ".".join([self.ttsEngineId,text_slice, hash, "wav"]) - return self.tts_cache_dir+"/"+filename + filename = ".".join([text_slice, hash, "wav"]) + return self.tts_cache_dir+"/"+self.ttsEngineId+"/"+filename def all_num_to_text(self,text:str): from utils.all_num_to_text import all_num_to_text