diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 1e5e7b111..bb66fa79e 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -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": { diff --git a/astrbot/core/pipeline/result_decorate/stage.py b/astrbot/core/pipeline/result_decorate/stage.py index 5604ab3c2..55abdfb0b 100644 --- a/astrbot/core/pipeline/result_decorate/stage.py +++ b/astrbot/core/pipeline/result_decorate/stage.py @@ -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}"