mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
feat: support doubao online ASR
This commit is contained in:
parent
75f75f97a6
commit
7da080a7cc
1 changed files with 0 additions and 14 deletions
|
|
@ -44,20 +44,6 @@ async def handleAudioMessage(conn, audio):
|
||||||
conn.asr_audio.clear()
|
conn.asr_audio.clear()
|
||||||
conn.reset_vad_states()
|
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):
|
async def handleCMDMessage(conn, text):
|
||||||
cmd_exit = conn.cmd_exit
|
cmd_exit = conn.cmd_exit
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue