feat: support doubao online ASR

This commit is contained in:
胡垚 2025-02-19 14:58:42 +08:00
parent 75f75f97a6
commit 7da080a7cc

View file

@ -44,20 +44,6 @@ async def handleAudioMessage(conn, audio):
conn.asr_audio.clear()
conn.reset_vad_states()
async def speechToText(conn):
conn.client_abort = False
conn.asr_server_receive = False
text, file_path = await conn.asr.speech_to_text(conn.asr_audio, conn.session_id)
logger.info(f"识别文本: {text}")
text_len, text_without_punctuation = remove_punctuation_and_length(text)
if text_len <= conn.max_cmd_length and await handleCMDMessage(conn, text_without_punctuation):
return
if text_len > 0:
await startToChat(conn, text)
else:
conn.asr_server_receive = True
conn.asr_audio.clear()
conn.reset_vad_states()
async def handleCMDMessage(conn, text):
cmd_exit = conn.cmd_exit