mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
fix: Avoid the same filename under multithreading (#933)
This commit is contained in:
@@ -34,7 +34,7 @@ class PyttsVoice(Voice):
|
||||
|
||||
def textToVoice(self, text):
|
||||
try:
|
||||
# avoid the same filename
|
||||
# Avoid the same filename under multithreading
|
||||
wavFileName = "reply-" + str(int(time.time())) + "-" + str(hash(text) & 0x7FFFFFFF) + ".wav"
|
||||
wavFile = TmpDir().path() + wavFileName
|
||||
logger.info("[Pytts] textToVoice text={} voice file name={}".format(text, wavFile))
|
||||
|
||||
Reference in New Issue
Block a user