feat: add VOX TTS server on port 33003 with webui integration
- New vox-server/server.py (HTTP API matching morshu-server pattern) - Added voxstart/voxstop/voxstatus commands to ttstoy cog - WebUI /api/tts/generate and /api/mc/tts now support VOX mode - Cog_unload stops VOX server automatically
This commit is contained in:
@@ -428,6 +428,20 @@ def api_tts_generate():
|
||||
except Exception as e:
|
||||
return jsonify({"error": f"DECTalk server error: {e}"}), 500
|
||||
|
||||
if mode == "vox":
|
||||
try:
|
||||
pack = gcfg.get("vox_pack", "vox")
|
||||
r = requests.get("http://127.0.0.1:33003/say", params={"text": text, "pack": pack}, timeout=60)
|
||||
r.raise_for_status()
|
||||
job_id = str(uuid.uuid4())
|
||||
out_path = tempfile.mktemp(suffix=".wav")
|
||||
with open(out_path, "wb") as f:
|
||||
f.write(r.content)
|
||||
_tts_jobs[job_id] = {"status": "done", "path": out_path, "text": text, "user": discord_name, "engine": "vox"}
|
||||
return jsonify({"job_id": job_id})
|
||||
except Exception as e:
|
||||
return jsonify({"error": f"VOX server error: {e}"}), 500
|
||||
|
||||
if mode != "chatterbox":
|
||||
return jsonify({"error": f"Generate Only is not available for '{mode}' mode via web UI."}), 400
|
||||
|
||||
@@ -684,6 +698,13 @@ def api_mc_tts():
|
||||
r.raise_for_status()
|
||||
return r.content, 200, {"Content-Type": "audio/wav"}
|
||||
|
||||
elif mode == "vox":
|
||||
gcfg = get_global_config()
|
||||
pack = gcfg.get("vox_pack", "vox")
|
||||
r = requests.get("http://127.0.0.1:33003/say", params={"text": text, "pack": pack}, timeout=60)
|
||||
r.raise_for_status()
|
||||
return r.content, 200, {"Content-Type": "audio/wav"}
|
||||
|
||||
else:
|
||||
return jsonify({"error": f"Unknown mode: {mode}"}), 400
|
||||
|
||||
|
||||
Reference in New Issue
Block a user