finish
This commit is contained in:
@@ -851,6 +851,17 @@ async def websocket_endpoint(websocket: WebSocket):
|
||||
# 4. 如果有识别结果,发送ASR文字到ESP32
|
||||
if asr_text:
|
||||
print(f"ASR result: {asr_text}")
|
||||
|
||||
# 主动下发字体数据
|
||||
try:
|
||||
unique_chars = set(asr_text)
|
||||
code_list = [str(ord(c)) for c in unique_chars]
|
||||
print(f"Sending font data for {len(code_list)} characters...")
|
||||
success_count, failed = await send_font_batch_with_retry(websocket, code_list)
|
||||
print(f"Font data sent: {success_count} success, {len(failed)} failed")
|
||||
except Exception as e:
|
||||
print(f"Error sending font data: {e}")
|
||||
|
||||
# 发送 ASR 文字到 ESP32 显示
|
||||
await websocket.send_text(f"ASR:{asr_text}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user