mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 10:03:54 +08:00
Merge pull request #1529 from xinnan-tech/py_wakeup_text
Py wakeup text
This commit is contained in:
@@ -538,7 +538,7 @@ export default {
|
|||||||
|
|
||||||
.data-table {
|
.data-table {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
overflow-y: auto;
|
overflow-y: hidden;
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
--table-max-height: calc(100vh - 40vh);
|
--table-max-height: calc(100vh - 40vh);
|
||||||
max-height: var(--table-max-height);
|
max-height: var(--table-max-height);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import queue
|
import queue
|
||||||
import uuid
|
import uuid
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -169,15 +170,18 @@ class TTSProviderBase(ABC):
|
|||||||
content_type=ContentType.ACTION,
|
content_type=ContentType.ACTION,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.tts_text_queue.put(
|
# 对于单句的文本,进行分段处理
|
||||||
TTSMessageDTO(
|
segments = re.split(r'([。!?!?;;\n])', content_detail)
|
||||||
sentence_id=sentence_id,
|
for seg in segments:
|
||||||
sentence_type=SentenceType.MIDDLE,
|
self.tts_text_queue.put(
|
||||||
content_type=content_type,
|
TTSMessageDTO(
|
||||||
content_detail=content_detail,
|
sentence_id=sentence_id,
|
||||||
content_file=content_file,
|
sentence_type=SentenceType.MIDDLE,
|
||||||
|
content_type=content_type,
|
||||||
|
content_detail=seg,
|
||||||
|
content_file=content_file,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
self.tts_text_queue.put(
|
self.tts_text_queue.put(
|
||||||
TTSMessageDTO(
|
TTSMessageDTO(
|
||||||
sentence_id=sentence_id,
|
sentence_id=sentence_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user