feat: 部分语音聊天功能

This commit is contained in:
2025-06-30 10:49:24 +08:00
parent 06e6b4a8c9
commit ac5e68f5a5
10 changed files with 594 additions and 25 deletions

View File

@@ -5,7 +5,6 @@ from aip import AipSpeech
from app.constants.asr import APP_ID, API_KEY, SECRET_KEY
import json
# 导入修改后的TTS模块
from . import tts
router = APIRouter()
@@ -62,7 +61,7 @@ async def websocket_online_count(websocket: WebSocket):
await websocket.send_json({"type": "asr_result", "result": asr_text})
temp_buffer = bytes()
# 修改:TTS处理支持消息ID
# TTS处理
elif msg_type == "tts_text":
message_id = data.get("messageId")
text = data.get("text", "")