From dbdb032adb61f37e18831f914a2051be373458f6 Mon Sep 17 00:00:00 2001 From: lanhao Date: Thu, 2 Jul 2026 21:34:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B1=86=E5=8C=85=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E8=A1=A5=E5=85=A8pitch=5Fratio=E5=92=8Cvolume=5Fratio=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端声调/音量滑块现在对豆包引擎也生效了 Co-Authored-By: Claude Opus 4.7 --- backend/app/services/doubao_service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/app/services/doubao_service.py b/backend/app/services/doubao_service.py index 88d168e..b57d433 100644 --- a/backend/app/services/doubao_service.py +++ b/backend/app/services/doubao_service.py @@ -28,6 +28,8 @@ def synthesize_doubao(text, speed=1.0, pitch=0, volume=1.0, emotion='neutral'): 'voice_type': 'S_LK0j18H72', 'encoding': 'mp3', 'speed_ratio': speed, + 'pitch_ratio': max(0.1, min(3.0, 1.0 + pitch / 12)), # 前端-12~12映射到0.1~3.0 + 'volume_ratio': max(0.1, min(3.0, volume)), # 前端0~10,API 0.1~3.0 'bitrate': 128000, }, 'request': {