Lock MVP voice (Michael, native settings); native /tts route
This commit is contained in:
+5
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user