From 8413f75f2eea7cb5202f9de213f5e127819e6909 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Wed, 26 Mar 2025 15:44:17 +0800 Subject: [PATCH] 'commit' --- AI/WxMini/Start.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AI/WxMini/Start.py b/AI/WxMini/Start.py index c2695e9b..dc647cd5 100644 --- a/AI/WxMini/Start.py +++ b/AI/WxMini/Start.py @@ -314,7 +314,9 @@ async def reply(person_id: str = Form(...), # 调用 TTS 生成 MP3 uuid_str = str(uuid.uuid4()) timestamp = int(time.time()) - tts_file = f"audio/{uuid_str}_{timestamp}.mp3" + # 生成年月日的目录名称 + audio_dir = f"audio/{time.strftime('%Y-%m-%d', time.localtime())}" + tts_file = f"{audio_dir}_{uuid_str}_{timestamp}.mp3" # 生成 TTS 音频数据(不落盘) t = TTS(None) # 传入 None 表示不保存到本地文件