From b7c59d8c8558a46a52b1fe57d4d4a74e5059a7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dieter=20Schl=C3=BCter?= Date: Thu, 18 Jun 2026 09:49:25 +0200 Subject: [PATCH] feat(web): Stimmen-Umschalter (piper/chatterbox/cloud) in der UI Dropdown im Menue setzt tts_provider als Request-Override fuer Text- und Sprach-Turns -> live umschaltbar zwischen schnellem piper, hochwertigem chatterbox und Cloud. Asset-Version v5. Co-Authored-By: Claude Opus 4.8 --- app/web/app.js | 11 +++++++++-- app/web/index.html | 11 +++++++++-- app/web/style.css | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/web/app.js b/app/web/app.js index 8d6d5dd..8416444 100644 --- a/app/web/app.js +++ b/app/web/app.js @@ -7,6 +7,13 @@ const statusEl = $("#status"); const promptEl = $("#prompt"); const formEl = $("#prompt-form"); const micBtn = $("#mic"); +const ttsSel = $("#tts"); + +// Gewählter TTS-Provider (leer = Default/piper) als Request-Override. +function overrides() { + const t = ttsSel && ttsSel.value; + return t ? { tts_provider: t } : {}; +} let busy = false; // Session-ID pro Nutzer (sonst "gehoert einem anderen Nutzer"-Konflikt). Wird aus @@ -169,7 +176,7 @@ async function sendText(text) { addMessage("user", text); statusEl.textContent = "denkt …"; await runTurn("/ws/chat", (ws) => { - ws.send(JSON.stringify({ text, stream: true, audio_stream: true })); + ws.send(JSON.stringify({ text, stream: true, audio_stream: true, ...overrides() })); }); busy = false; } @@ -219,7 +226,7 @@ async function sendVoice(bytes) { await ensureSession(); statusEl.textContent = "verarbeite Sprache …"; await runTurn("/ws/voice", (ws) => { - ws.send(JSON.stringify({ type: "start", format: "webm", stream: true, audio_stream: true })); + ws.send(JSON.stringify({ type: "start", format: "webm", stream: true, audio_stream: true, ...overrides() })); ws.send(bytes); ws.send(JSON.stringify({ type: "end" })); }); diff --git a/app/web/index.html b/app/web/index.html index bc210fa..316c7eb 100644 --- a/app/web/index.html +++ b/app/web/index.html @@ -4,13 +4,20 @@ Voice Assistant - +