aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_wav.mjs
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 12:45:52 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 12:45:52 +0100
commitc30385b92ff767f8aaff58bf0bc1e5c42ce9036c (patch)
tree724f3fca1eacf2ba2cd3d7046befd8b464e42e97 /tests/test_wav.mjs
parentc8f5a1e68d3294d4e1c7be3c386f3cc538eeb7af (diff)
downloaddeck-it-c30385b92ff767f8aaff58bf0bc1e5c42ce9036c.tar.gz
deck-it-c30385b92ff767f8aaff58bf0bc1e5c42ce9036c.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_wav.mjs')
-rw-r--r--tests/test_wav.mjs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_wav.mjs b/tests/test_wav.mjs
index 68f97d0..e28be9a 100644
--- a/tests/test_wav.mjs
+++ b/tests/test_wav.mjs
@@ -15,7 +15,7 @@
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import assert from "node:assert/strict";
-import { encodeWav } from "../static/wav.js";
+import { encodeWav, peak } from "../static/wav.js";
const buf = encodeWav(new Float32Array([0, 1, -1]), 16000);
const v = new DataView(buf);
@@ -29,4 +29,6 @@ assert.equal(v.getUint32(24, true), 16000);
assert.equal(v.getUint16(34, true), 16);
assert.equal(v.getUint32(40, true), 6);
assert.deepEqual([v.getInt16(44, true), v.getInt16(46, true), v.getInt16(48, true)], [0, 32767, -32768]);
+assert.equal(peak(buf), 32768);
+assert.equal(peak(encodeWav(new Float32Array([0.001, -0.002]), 16000)), 65);
console.log("wav ok");