tts : add text output alongside voice (Fix #1085)

This commit is contained in:
YOO_koishi
2025-04-19 14:44:02 +08:00
parent 56001ed272
commit 31d8c40eca
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -61,6 +61,7 @@ DEFAULT_CONFIG = {
"provider_tts_settings": {
"enable": False,
"provider_id": "",
"dual_output": False,
},
"provider_ltm_settings": {
"group_icl_enable": False,
@@ -1102,6 +1103,12 @@ CONFIG_METADATA_2 = {
"type": "string",
"hint": "文本转语音提供商 ID。如果不填写将使用载入的第一个提供商。",
},
"dual_output": {
"description": "启用语音和文字双输出",
"type": "bool",
"hint": "启用后,Bot 将同时输出语音和文字消息。",
"obvious_hint": True,
},
},
},
"provider_ltm_settings": {
@@ -184,6 +184,8 @@ class ResultDecorateStage(Stage):
new_chain.append(
Record(file=audio_path, url=audio_path)
)
if(self.ctx.astrbot_config["provider_tts_settings"]["dual_output"]):
new_chain.append(comp)
else:
logger.error(
f"由于 TTS 音频文件没找到,消息段转语音失败: {comp.text}"