diff --git a/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java b/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java index 2590a566..44294756 100644 --- a/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java +++ b/main/manager-api/src/main/java/xiaozhi/common/constant/Constant.java @@ -227,7 +227,7 @@ public interface Constant { /** * 版本号 */ - public static final String VERSION = "0.5.4"; + public static final String VERSION = "0.5.5"; /** * 无效固件URL diff --git a/main/manager-api/src/main/resources/db/changelog/202506080955.sql b/main/manager-api/src/main/resources/db/changelog/202506080955.sql new file mode 100644 index 00000000..5f5e799e --- /dev/null +++ b/main/manager-api/src/main/resources/db/changelog/202506080955.sql @@ -0,0 +1,3 @@ +-- 智控台开启唤醒词加速 +update `sys_params` set param_value = '你好小智;你好小志;小爱同学;你好小鑫;你好小新;小美同学;小龙小龙;喵喵同学;小滨小滨;小冰小冰;嘿你好呀' where param_code = 'wakeup_words'; +update `sys_params` set param_value = 'true' where param_code = 'enable_wakeup_words_response_cache'; diff --git a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml index cb3007aa..f33d28a2 100755 --- a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml @@ -197,4 +197,11 @@ databaseChangeLog: changes: - sqlFile: encoding: utf8 - path: classpath:db/changelog/202506051538.sql \ No newline at end of file + path: classpath:db/changelog/202506051538.sql + - changeSet: + id: 202506080955 + author: hrz + changes: + - sqlFile: + encoding: utf8 + path: classpath:db/changelog/202506080955.sql \ No newline at end of file diff --git a/main/xiaozhi-server/config/logger.py b/main/xiaozhi-server/config/logger.py index 7bd22c43..a99013aa 100644 --- a/main/xiaozhi-server/config/logger.py +++ b/main/xiaozhi-server/config/logger.py @@ -5,7 +5,7 @@ from config.config_loader import load_config from config.settings import check_config_file from datetime import datetime -SERVER_VERSION = "0.5.4" +SERVER_VERSION = "0.5.5" _logger_initialized = False diff --git a/main/xiaozhi-server/core/handle/helloHandle.py b/main/xiaozhi-server/core/handle/helloHandle.py index 0232c9ac..1edeefcd 100644 --- a/main/xiaozhi-server/core/handle/helloHandle.py +++ b/main/xiaozhi-server/core/handle/helloHandle.py @@ -3,7 +3,7 @@ import json import random import asyncio from core.utils.util import audio_to_data -from core.handle.sendAudioHandle import send_stt_message +from core.handle.sendAudioHandle import sendAudioMessage, send_stt_message from core.utils.util import remove_punctuation_and_length, opus_datas_to_wav_bytes from core.providers.tts.dto.dto import ContentType, SentenceType from core.handle.mcpHandle import ( @@ -74,8 +74,10 @@ async def checkWakeupWords(conn, text): # 播放唤醒词回复 conn.client_abort = False opus_packets, _ = audio_to_data(response["file_path"]) - conn.tts.tts_audio_queue.put((SentenceType.FIRST, opus_packets, response["text"])) - conn.tts.tts_audio_queue.put((SentenceType.LAST, [], None)) + + conn.logger.bind(tag=TAG).info(f"播放唤醒词回复: {response['text']}") + await sendAudioMessage(conn, SentenceType.FIRST, opus_packets, response["text"]) + await sendAudioMessage(conn, SentenceType.LAST, [], None) # 检查是否需要更新唤醒词回复 if time.time() - response["time"] > WAKEUP_CONFIG["refresh_time"]: diff --git a/main/xiaozhi-server/core/handle/sendAudioHandle.py b/main/xiaozhi-server/core/handle/sendAudioHandle.py index ea81b7ed..2bf55e65 100644 --- a/main/xiaozhi-server/core/handle/sendAudioHandle.py +++ b/main/xiaozhi-server/core/handle/sendAudioHandle.py @@ -34,6 +34,7 @@ emoji_map = { async def sendAudioMessage(conn, sentenceType, audios, text): # 发送句子开始消息 + conn.logger.bind(tag=TAG).info(f"发送音频消息: {sentenceType}, {text}") if text is not None: emotion = analyze_emotion(text) emoji = emoji_map.get(emotion, "🙂") # 默认使用笑脸 diff --git a/main/xiaozhi-server/core/providers/tts/huoshan_double_stream.py b/main/xiaozhi-server/core/providers/tts/huoshan_double_stream.py index 8245b754..83a2d83a 100644 --- a/main/xiaozhi-server/core/providers/tts/huoshan_double_stream.py +++ b/main/xiaozhi-server/core/providers/tts/huoshan_double_stream.py @@ -188,10 +188,8 @@ class TTSProvider(TTSProviderBase): def tts_text_priority_thread(self): """火山引擎双流式TTS的文本处理线程""" - logger.bind(tag=TAG).info("TTS文本处理线程启动") while not self.conn.stop_event.is_set(): try: - logger.bind(tag=TAG).debug("等待TTS文本队列消息...") message = self.tts_text_queue.get(timeout=1) logger.bind(tag=TAG).debug( f"收到TTS任务|{message.sentence_type.name} | {message.content_type.name} | 会话ID: {self.conn.sentence_id}" diff --git a/main/xiaozhi-server/core/providers/tts/linkerai.py b/main/xiaozhi-server/core/providers/tts/linkerai.py index 649ed51d..69127e8a 100644 --- a/main/xiaozhi-server/core/providers/tts/linkerai.py +++ b/main/xiaozhi-server/core/providers/tts/linkerai.py @@ -93,6 +93,8 @@ class TTSProvider(TTSProviderBase): self.processed_chars += len(full_text) else: self._process_before_stop_play_files() + else: + self._process_before_stop_play_files() def to_tts_single_stream(self, text, is_last=False): try: