This commit is contained in:
恍兮惚兮 2024-05-15 02:00:20 +08:00
parent a001ba38c7
commit eda4c303ba
3 changed files with 11 additions and 3 deletions

View File

@ -119,6 +119,7 @@ class AnkiWindow(QDialog):
}
)
media = []
tempfiles=[]
for k, _ in [("audio", self.audiofile), ("image", self.cropedimagepath)]:
if _:
media.append(
@ -130,6 +131,7 @@ class AnkiWindow(QDialog):
}
]
)
tempfiles.append(_)
else:
media.append([])
@ -145,7 +147,11 @@ class AnkiWindow(QDialog):
media[0],
media[1],
)
for _ in tempfiles:
try:
os.remove(_)
except:
pass
class searchwordW(closeashidewindow):
getnewsentencesignal = pyqtSignal(str, bool)

View File

@ -15,6 +15,7 @@ model_htmlfront = """
{{explain}}
<br>
{{image}}
<div class='icon_audio'>{{audio}}</div>
"""
model_htmlback = """
{{word}}
@ -22,4 +23,5 @@ model_htmlback = """
{{explain}}
<br>
{{image}}
<div class='icon_audio'>{{audio}}</div>
"""

View File

@ -1,5 +1,5 @@
from myutils.config import globalconfig
import threading
import threading, os
class TTSbase:
@ -71,4 +71,4 @@ class TTSbase:
voice = globalconfig["reader"][self.typename]["voice"]
voice_index = self.voicelist.index(voice)
fname = self.speak(content, rate, voice, voice_index)
return fname
return os.path.abspath(fname)