Lock MVP voice (Michael, native settings); native /tts route

This commit is contained in:
Audiobook Producer
2026-10-17 16:44:28 -05:00
parent 444cee7f76
commit ca5592b964
4 changed files with 136 additions and 6 deletions
+5 -1
View File
@@ -55,7 +55,11 @@ def plan(cfg, segs):
def speak(cfg, text):
v = cfg["voice"]
body = {"model": v["model"], "input": text, "voice": v["voice"], "response_format": "wav"}
if v.get("api") == "chatterbox_tts":
# Native Chatterbox server route: the only one that accepts exaggeration, cfg_weight and temperature per request.
body = {"text": text, "voice_mode": "predefined", "predefined_voice_id": v["voice"], "output_format": "wav"}
else:
body = {"model": v["model"], "input": text, "voice": v["voice"], "response_format": "wav"}
body.update(v.get("extra") or {})
req = urllib.request.Request(v["endpoint"], json.dumps(body).encode(), {"Content-Type": "application/json"})
with urllib.request.urlopen(req, timeout=v["timeout_s"]) as r: