feat: 支持音色切换
This commit is contained in:
@@ -8,7 +8,7 @@ from . import tts
|
||||
from app.constants.model_data import tip_message, base_url, headers
|
||||
|
||||
|
||||
async def process_voice_conversation(websocket: WebSocket, asr_text: str, message_id: str):
|
||||
async def process_voice_conversation(websocket: WebSocket, asr_text: str, message_id: str, speaker: str):
|
||||
try:
|
||||
print(f"开始处理语音对话 [{message_id}]: {asr_text}")
|
||||
|
||||
@@ -92,7 +92,7 @@ async def process_voice_conversation(websocket: WebSocket, asr_text: str, messag
|
||||
|
||||
# 启动TTS处理完整内容
|
||||
print(f"启动完整TTS处理 [{message_id}]: {full_response}")
|
||||
await tts.handle_tts_text(websocket, message_id, full_response)
|
||||
await tts.handle_tts_text(websocket, message_id, full_response, speaker)
|
||||
|
||||
except Exception as e:
|
||||
print(f"语音对话处理异常 [{message_id}]: {e}")
|
||||
|
||||
Reference in New Issue
Block a user