Merge pull request #1327 from YOOkoishi/tts-feat-branck

TTS : add text output alongside voice (Fix #1085)
This commit is contained in:
Soulter
2025-04-20 16:07:06 +08:00
committed by GitHub
2 changed files with 9 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ DEFAULT_CONFIG = {
"provider_tts_settings": {
"enable": False,
"provider_id": "",
"dual_output": False,
},
"provider_ltm_settings": {
"group_icl_enable": False,
@@ -1108,6 +1109,12 @@ CONFIG_METADATA_2 = {
"type": "string",
"hint": "文本转语音提供商 ID。如果不填写将使用载入的第一个提供商。",
},
"dual_output": {
"description": "启用语音和文字双输出",
"type": "bool",
"hint": "启用后Bot 将同时输出语音和文字消息。",
"obvious_hint": True,
},
},
},
"provider_ltm_settings": {

View File

@@ -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}"