Skip to content

Commit 33836da

Browse files
authored
Merge pull request #1327 from YOOkoishi/tts-feat-branck
TTS : add text output alongside voice (Fix #1085)
2 parents 0de6d0e + 31d8c40 commit 33836da

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

astrbot/core/config/default.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"provider_tts_settings": {
6363
"enable": False,
6464
"provider_id": "",
65+
"dual_output": False,
6566
},
6667
"provider_ltm_settings": {
6768
"group_icl_enable": False,
@@ -1108,6 +1109,12 @@
11081109
"type": "string",
11091110
"hint": "文本转语音提供商 ID。如果不填写将使用载入的第一个提供商。",
11101111
},
1112+
"dual_output": {
1113+
"description": "启用语音和文字双输出",
1114+
"type": "bool",
1115+
"hint": "启用后,Bot 将同时输出语音和文字消息。",
1116+
"obvious_hint": True,
1117+
},
11111118
},
11121119
},
11131120
"provider_ltm_settings": {

astrbot/core/pipeline/result_decorate/stage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ async def process(
184184
new_chain.append(
185185
Record(file=audio_path, url=audio_path)
186186
)
187+
if(self.ctx.astrbot_config["provider_tts_settings"]["dual_output"]):
188+
new_chain.append(comp)
187189
else:
188190
logger.error(
189191
f"由于 TTS 音频文件没找到,消息段转语音失败: {comp.text}"

0 commit comments

Comments
 (0)