mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
feat: 支持腾讯TTS声音一句话复刻后的合成
This commit is contained in:
parent
0f3806d358
commit
8f126e6e2a
1 changed files with 4 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ class TTSProvider(TTSProviderBase):
|
||||||
self.voice = config.get("private_voice")
|
self.voice = config.get("private_voice")
|
||||||
else:
|
else:
|
||||||
self.voice = int(config.get("voice"))
|
self.voice = int(config.get("voice"))
|
||||||
|
self.fast_voice_type = config.get("fast_voice_type")
|
||||||
self.api_url = "https://tts.tencentcloudapi.com" # 正确的API端点
|
self.api_url = "https://tts.tencentcloudapi.com" # 正确的API端点
|
||||||
self.region = config.get("region")
|
self.region = config.get("region")
|
||||||
self.output_file = config.get("output_dir")
|
self.output_file = config.get("output_dir")
|
||||||
|
|
@ -135,6 +136,9 @@ class TTSProvider(TTSProviderBase):
|
||||||
"VoiceType": int(self.voice), # 音色
|
"VoiceType": int(self.voice), # 音色
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.fast_voice_type: # 如果不为空则添加,在使用声音复刻时可能需要此参数
|
||||||
|
request_json["FastVoiceType"] = str(self.fast_voice_type)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# 获取请求头(每次请求都重新生成,以确保时间戳和签名是最新的)
|
# 获取请求头(每次请求都重新生成,以确保时间戳和签名是最新的)
|
||||||
headers = self._get_auth_headers(request_json)
|
headers = self._get_auth_headers(request_json)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue