Fix long audio bug (#158)

* update:异步生成音频

* update:优化LLM断句

---------

Co-authored-by: hrz <1710360675@qq.com>
This commit is contained in:
欣南科技
2025-03-01 01:54:55 +08:00
committed by GitHub
co-authored by hrz
parent 2c88a36f32
commit b94842c312
8 changed files with 73 additions and 234 deletions
+2 -6
View File
@@ -1,8 +1,7 @@
from config.logger import setup_logging
import asyncio
import time
from core.utils.util import remove_punctuation_and_length
from core.handle.sendAudioHandle import schedule_with_interrupt, send_stt_message
from core.handle.sendAudioHandle import send_stt_message
TAG = __name__
logger = setup_logging()
@@ -61,10 +60,7 @@ async def handleCMDMessage(conn, text):
async def startToChat(conn, text):
# 异步发送 stt 信息
stt_task = asyncio.create_task(
schedule_with_interrupt(0, send_stt_message(conn, text))
)
conn.scheduled_tasks.append(stt_task)
await send_stt_message(conn, text)
conn.executor.submit(conn.chat, text)