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)