feat: 字数限制2000 + MiniMax emotion参数 + 前端情绪全局选择模式

This commit is contained in:
lanhao
2026-06-30 23:47:23 +08:00
parent d6edc69c65
commit 81460f06d7
4 changed files with 57 additions and 104 deletions
+2 -1
View File
@@ -3,7 +3,7 @@ import base64
import requests
from io import BytesIO
def synthesize_minimax(text, speed=1.0, pitch=0, volume=1.0):
def synthesize_minimax(text, speed=1.0, pitch=0, volume=1.0, emotion='neutral'):
"""调用MiniMax TTS API"""
api_key = os.getenv('MINIMAX_API_KEY', '')
if not api_key:
@@ -27,6 +27,7 @@ def synthesize_minimax(text, speed=1.0, pitch=0, volume=1.0):
'speed': speed,
'vol': volume_int,
'pitch': pitch,
'emotion': emotion,
},
'audio_setting': {
'audio_sample_rate': 32000,