From a8f559b22cdbafec6925d5ca80e566533018b80a Mon Sep 17 00:00:00 2001 From: Sakura-RanChen <1908198662@qq.com> Date: Fri, 6 Jun 2025 16:29:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?update:=20tts=5Fone=5Fsentence=E5=8D=95?= =?UTF-8?q?=E5=8F=A5=E6=96=87=E6=9C=AC=E5=88=86=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiaozhi-server/core/providers/tts/base.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/main/xiaozhi-server/core/providers/tts/base.py b/main/xiaozhi-server/core/providers/tts/base.py index 70c68ee7..fc103bed 100644 --- a/main/xiaozhi-server/core/providers/tts/base.py +++ b/main/xiaozhi-server/core/providers/tts/base.py @@ -1,4 +1,5 @@ import os +import re import queue import uuid import asyncio @@ -141,15 +142,18 @@ class TTSProviderBase(ABC): content_type=ContentType.ACTION, ) ) - self.tts_text_queue.put( - TTSMessageDTO( - sentence_id=sentence_id, - sentence_type=SentenceType.MIDDLE, - content_type=content_type, - content_detail=content_detail, - content_file=content_file, + # 对于单句的文本,进行分段处理 + segments = re.split(r'([。!?!?;;\n])', content_detail) + for seg in segments: + self.tts_text_queue.put( + TTSMessageDTO( + sentence_id=sentence_id, + sentence_type=SentenceType.MIDDLE, + content_type=content_type, + content_detail=seg, + content_file=content_file, + ) ) - ) self.tts_text_queue.put( TTSMessageDTO( sentence_id=sentence_id, From b273181ba65a9968e9c8ee1001d98b8badaa4df3 Mon Sep 17 00:00:00 2001 From: Sakura-RanChen <1908198662@qq.com> Date: Mon, 9 Jun 2025 15:17:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/manager-web/src/views/DictManagement.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/manager-web/src/views/DictManagement.vue b/main/manager-web/src/views/DictManagement.vue index f4de8350..9f6c80ac 100644 --- a/main/manager-web/src/views/DictManagement.vue +++ b/main/manager-web/src/views/DictManagement.vue @@ -538,7 +538,7 @@ export default { .data-table { border-radius: 6px; - overflow-y: auto; + overflow-y: hidden; background-color: transparent !important; --table-max-height: calc(100vh - 40vh); max-height: var(--table-max-height);