Update web client

This commit is contained in:
Xin Wang
2026-02-06 10:46:24 +08:00
parent 5c03cf2b1f
commit cb35d87eb4
2 changed files with 97 additions and 3 deletions

View File

@@ -331,7 +331,6 @@
<button class="secondary" id="refreshDevicesBtn">Refresh Devices</button>
<button class="good" id="startMicBtn">Start Mic</button>
<button class="secondary" id="stopMicBtn">Stop Mic</button>
<button class="bad" id="interruptBtn">Interrupt</button>
</div>
<h2>Chat</h2>
@@ -372,7 +371,6 @@
const outputSelect = document.getElementById("outputSelect");
const startMicBtn = document.getElementById("startMicBtn");
const stopMicBtn = document.getElementById("stopMicBtn");
const interruptBtn = document.getElementById("interruptBtn");
const refreshDevicesBtn = document.getElementById("refreshDevicesBtn");
const sendChatBtn = document.getElementById("sendChatBtn");
const clearLogBtn = document.getElementById("clearLogBtn");
@@ -504,6 +502,7 @@
setStatus(true, "Session open");
logLine("sys", "WebSocket connected");
ensureAudioContext();
sendCommand({ command: "invite", option: { codec: "pcm", sampleRate: targetSampleRate } });
};
ws.onclose = () => {
@@ -653,7 +652,6 @@
});
startMicBtn.addEventListener("click", startMic);
stopMicBtn.addEventListener("click", stopMic);
interruptBtn.addEventListener("click", () => sendCommand({ command: "interrupt" }));
sendChatBtn.addEventListener("click", () => {
const text = chatInput.value.trim();
if (!text) return;