From ebeb62f72dfbc7896f59eb50320774cbc8d7b7cf Mon Sep 17 00:00:00 2001 From: david-ajax Date: Tue, 7 Oct 2025 23:30:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- screens.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/screens.py b/screens.py index 8d1c905..79adebf 100644 --- a/screens.py +++ b/screens.py @@ -19,7 +19,6 @@ from textual.screen import Screen from textual.worker import Worker, get_current_worker import pathlib import threading -import edge_tts as tts from playsound import playsound import particles as pt from reactor import Reactor, Apparatus, Glimpse @@ -95,6 +94,7 @@ class PrecachingScreen(Screen): cache = cache_dir / f"{aux.get_md5(text)}.wav" if not cache.exists(): try: + import edge_tts as tts communicate = tts.Communicate(text, "zh-CN-XiaoxiaoNeural") communicate.save_sync(str(cache)) return True @@ -330,6 +330,7 @@ class MemScreen(Screen): cache_dir.mkdir(parents=True, exist_ok=True) cache = cache_dir / f"{aux.get_md5(self.reactor.current_atom[1].content.replace('/',''))}.wav" if not cache.exists(): + import edge_tts as tts communicate = tts.Communicate( self.reactor.current_atom[1].content.replace("/", ""), "zh-CN-XiaoxiaoNeural",