d6edc69c65
- Flask backend with MiniMax and CosyVoice TTS engines - Frontend UI with emotion tags, speed/pitch/volume controls - Nginx reverse proxy configuration - Dual engine support (MiniMax speech-2.8-hd, CosyVoice v3.5-flash)
11 lines
468 B
Python
11 lines
468 B
Python
def synthesize_minimax(text):
|
|
url = "https://api.minimaxi.com/v1/t2a_v2"
|
|
headers = {"Authorization": f"Bearer {MINIMAX_API_KEY}", "Content-Type": "application/json"}
|
|
payload = {
|
|
"model": "speech-02-turbo",
|
|
"text": text,
|
|
"voice_setting": {"voice_id": MINIMAX_VOICE_ID}
|
|
}
|
|
resp = requests.post(url, headers=headers, json=payload)
|
|
return jsonify({"success": True, "model": "minimax", "text": text, "response": resp.json()})
|