mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 06:07:13 +08:00
fix: ignore remove file failed
This commit is contained in:
@@ -277,8 +277,12 @@ class WechatChannel(Channel):
|
|||||||
# 语音识别
|
# 语音识别
|
||||||
reply = super().build_voice_to_text(wav_path)
|
reply = super().build_voice_to_text(wav_path)
|
||||||
# 删除临时文件
|
# 删除临时文件
|
||||||
os.remove(wav_path)
|
try:
|
||||||
os.remove(mp3_path)
|
os.remove(wav_path)
|
||||||
|
os.remove(mp3_path)
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning("[WX]delete temp file error: " + str(e))
|
||||||
|
|
||||||
if reply.type != ReplyType.ERROR and reply.type != ReplyType.INFO:
|
if reply.type != ReplyType.ERROR and reply.type != ReplyType.INFO:
|
||||||
content = reply.content # 语音转文字后,将文字内容作为新的context
|
content = reply.content # 语音转文字后,将文字内容作为新的context
|
||||||
context.type = ContextType.TEXT
|
context.type = ContextType.TEXT
|
||||||
|
|||||||
Reference in New Issue
Block a user