mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 10:03:54 +08:00
Fix long audio bug (#158)
* update:异步生成音频 * update:优化LLM断句 --------- Co-authored-by: hrz <1710360675@qq.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import random
|
||||
import difflib
|
||||
import re
|
||||
import traceback
|
||||
from core.handle.sendAudioHandle import sendAudioMessage, send_stt_message
|
||||
from core.handle.sendAudioHandle import send_stt_message
|
||||
|
||||
TAG = __name__
|
||||
logger = setup_logging()
|
||||
@@ -102,7 +102,8 @@ class MusicHandler:
|
||||
conn.tts_last_text = selected_music
|
||||
conn.llm_finish_task = True
|
||||
opus_packets, duration = conn.tts.wav_to_opus_data(music_path)
|
||||
await sendAudioMessage(conn, opus_packets, duration, selected_music)
|
||||
|
||||
conn.audio_play_queue.put((opus_packets, selected_music))
|
||||
|
||||
except Exception as e:
|
||||
logger.bind(tag=TAG).error(f"播放音乐失败: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user