1 Commits
v0.3.8 ... main

Author SHA1 Message Date
ebeb62f72d 性能改进 2025-10-07 23:30:16 +08:00

View File

@@ -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",