From c30385b92ff767f8aaff58bf0bc1e5c42ce9036c Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 10 Nov 2026 12:45:52 +0100 Subject: fix(assistant): voice-only tab, tools in an overlay, silent clips dropped The first voice question on the tablet was a 0.66 s silent clip: the mic gave no feedback until the next poll, an extra tap made a near-empty recording, and the model invented a question from the silence. The mic now turns red on the tap itself, and a clip whose loudest sample is under 1500 (room noise measured ~260, speech 15000+) is not sent. Typing happens on the PC, so the text field, send button and the ask action are gone; the bar is a large mic and a stop icon. The presets and ops move into an overlay opened from the header, so the transcript gets the screen. Co-Authored-By: Claude Opus 5.5 --- static/wav.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'static/wav.js') diff --git a/static/wav.js b/static/wav.js index ada6302..b83fae2 100644 --- a/static/wav.js +++ b/static/wav.js @@ -34,6 +34,14 @@ export function encodeWav(samples, rate) { return buf; } +// The loudest sample of a 16-bit WAV from encodeWav, to tell silence. +export function peak(wav) { + const v = new DataView(wav); + let p = 0; + for (let i = 44; i + 1 < wav.byteLength; i += 2) p = Math.max(p, Math.abs(v.getInt16(i, true))); + return p; +} + export async function toWav(blob, rate = 16000) { const ctx = new AudioContext(); try { -- cgit v1.2.3