From 8f126e6e2a67fa7618e0cbee518b2edb0815ad2b Mon Sep 17 00:00:00 2001 From: kevin1sMe Date: Sat, 3 May 2025 23:58:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E8=85=BE=E8=AE=AFTTS?= =?UTF-8?q?=E5=A3=B0=E9=9F=B3=E4=B8=80=E5=8F=A5=E8=AF=9D=E5=A4=8D=E5=88=BB?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E5=90=88=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/providers/tts/tencent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/xiaozhi-server/core/providers/tts/tencent.py b/main/xiaozhi-server/core/providers/tts/tencent.py index f2501e2fc..c9d722f05 100644 --- a/main/xiaozhi-server/core/providers/tts/tencent.py +++ b/main/xiaozhi-server/core/providers/tts/tencent.py @@ -20,6 +20,7 @@ class TTSProvider(TTSProviderBase): self.voice = config.get("private_voice") else: self.voice = int(config.get("voice")) + self.fast_voice_type = config.get("fast_voice_type") self.api_url = "https://tts.tencentcloudapi.com" # 正确的API端点 self.region = config.get("region") self.output_file = config.get("output_dir") @@ -135,6 +136,9 @@ class TTSProvider(TTSProviderBase): "VoiceType": int(self.voice), # 音色 } + if self.fast_voice_type: # 如果不为空则添加,在使用声音复刻时可能需要此参数 + request_json["FastVoiceType"] = str(self.fast_voice_type) + try: # 获取请求头(每次请求都重新生成,以确保时间戳和签名是最新的) headers = self._get_auth_headers(request_json)