mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 10:03:54 +08:00
feat: 增加对豆包tts对话速率等控制
This commit is contained in:
@@ -385,6 +385,9 @@ TTS:
|
|||||||
appid: 你的火山引擎语音合成服务appid
|
appid: 你的火山引擎语音合成服务appid
|
||||||
access_token: 你的火山引擎语音合成服务access_token
|
access_token: 你的火山引擎语音合成服务access_token
|
||||||
cluster: volcano_tts
|
cluster: volcano_tts
|
||||||
|
speed_ratio: 1.0
|
||||||
|
volume_ratio: 1.0
|
||||||
|
pitch_ratio: 1.0
|
||||||
CosyVoiceSiliconflow:
|
CosyVoiceSiliconflow:
|
||||||
type: siliconflow
|
type: siliconflow
|
||||||
# 硅基流动TTS
|
# 硅基流动TTS
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ class TTSProvider(TTSProviderBase):
|
|||||||
else:
|
else:
|
||||||
self.voice = config.get("voice")
|
self.voice = config.get("voice")
|
||||||
|
|
||||||
|
self.speed_ratio = config.get("speed_ratio") if config.get("speed_ratio") else 1.0
|
||||||
|
self.volume_ratio = config.get("volume_ratio") if config.get("volume_ratio") else 1.0
|
||||||
|
self.pitch_ratio = config.get("pitch_ratio") if config.get("pitch_ratio") else 1.0
|
||||||
|
|
||||||
self.api_url = config.get("api_url")
|
self.api_url = config.get("api_url")
|
||||||
self.authorization = config.get("authorization")
|
self.authorization = config.get("authorization")
|
||||||
self.header = {"Authorization": f"{self.authorization}{self.access_token}"}
|
self.header = {"Authorization": f"{self.authorization}{self.access_token}"}
|
||||||
@@ -49,9 +53,9 @@ class TTSProvider(TTSProviderBase):
|
|||||||
"audio": {
|
"audio": {
|
||||||
"voice_type": self.voice,
|
"voice_type": self.voice,
|
||||||
"encoding": "wav",
|
"encoding": "wav",
|
||||||
"speed_ratio": 1.0,
|
"speed_ratio": self.speed_ratio,
|
||||||
"volume_ratio": 1.0,
|
"volume_ratio": self.volume_ratio,
|
||||||
"pitch_ratio": 1.0,
|
"pitch_ratio": self.pitch_ratio,
|
||||||
},
|
},
|
||||||
"request": {
|
"request": {
|
||||||
"reqid": str(uuid.uuid4()),
|
"reqid": str(uuid.uuid4()),
|
||||||
|
|||||||
Reference in New Issue
Block a user