Merge pull request #1529 from xinnan-tech/py_wakeup_text

Py wakeup text
This commit is contained in:
CGD
2025-06-10 11:16:18 +08:00
committed by GitHub
2 changed files with 13 additions and 9 deletions
+12 -8
View File
@@ -1,4 +1,5 @@
import os
import re
import queue
import uuid
import asyncio
@@ -169,15 +170,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,