From 4dde66339b25d22f0eb72e13e2315dd247d8c9cf Mon Sep 17 00:00:00 2001 From: Sakura-RanChen <1908198662@qq.com> Date: Tue, 27 Jan 2026 11:22:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85minimax=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/providers/tts/minimax_httpstream.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main/xiaozhi-server/core/providers/tts/minimax_httpstream.py b/main/xiaozhi-server/core/providers/tts/minimax_httpstream.py index 73ce1c1c..9f145933 100644 --- a/main/xiaozhi-server/core/providers/tts/minimax_httpstream.py +++ b/main/xiaozhi-server/core/providers/tts/minimax_httpstream.py @@ -216,6 +216,18 @@ class TTSProvider(TTSProviderBase): try: data = json.loads(json_str) + + # 检查业务层错误 + base_resp = data.get("base_resp", {}) + status_code = base_resp.get("status_code", 0) + if status_code != 0: + status_msg = base_resp.get("status_msg", "未知错误") + logger.bind(tag=TAG).error( + f"TTS请求失败, 错误码:{status_code}, 错误消息:{status_msg}" + ) + self.tts_audio_queue.put((SentenceType.LAST, [], None)) + return + status = data.get("data", {}).get("status", 1) audio_hex = data.get("data", {}).get("audio")