feat: 字数限制2000 + MiniMax emotion参数 + 前端情绪全局选择模式
This commit is contained in:
@@ -25,12 +25,13 @@ def synthesize():
|
||||
pitch = data.get('pitch', 0)
|
||||
volume = data.get('volume', 1.0)
|
||||
instruction = data.get('instruction') # 用于CosyVoice的情绪指令
|
||||
emotion = data.get('emotion', 'neutral') # 用于MiniMax的情绪参数
|
||||
|
||||
if not text.strip():
|
||||
return jsonify({'error': '文本不能为空'}), 400
|
||||
|
||||
if len(text) > 500:
|
||||
return jsonify({'error': '文本不能超过500字'}), 400
|
||||
if len(text) > 2000:
|
||||
return jsonify({'error': '文本不能超过2000字'}), 400
|
||||
|
||||
try:
|
||||
if engine == 'cosyvoice':
|
||||
@@ -46,7 +47,8 @@ def synthesize():
|
||||
text=text,
|
||||
speed=speed,
|
||||
pitch=pitch,
|
||||
volume=volume
|
||||
volume=volume,
|
||||
emotion=emotion
|
||||
)
|
||||
|
||||
return jsonify({
|
||||
|
||||
Reference in New Issue
Block a user