From 6b8e4447c05cd1a38be705708270c2a5ea2ca8f2 Mon Sep 17 00:00:00 2001 From: you Date: Sun, 22 Mar 2026 09:33:47 +0000 Subject: [PATCH] Audio: debug logs to trace why packets aren't playing --- public/audio.js | 6 ++++-- public/index.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/audio.js b/public/audio.js index a044e16e..d3f0017b 100644 --- a/public/audio.js +++ b/public/audio.js @@ -86,11 +86,13 @@ // === Core: Sonify a single packet === function sonifyPacket(pkt) { + console.log('[audio] sonifyPacket called, enabled:', audioEnabled, 'ctx:', audioCtx?.state, 'voices:', activeVoices); if (!audioEnabled || !audioCtx) return; - if (activeVoices >= MAX_VOICES) return; // voice stealing: just drop + if (activeVoices >= MAX_VOICES) return; const rawHex = pkt.raw || pkt.raw_hex || (pkt.packet && pkt.packet.raw_hex) || ''; - if (!rawHex || rawHex.length < 6) return; // need at least 3 bytes + console.log('[audio] rawHex len:', rawHex.length, 'first20:', rawHex.slice(0, 20)); + if (!rawHex || rawHex.length < 6) return; // Parse raw hex to byte array const allBytes = []; diff --git a/public/index.html b/public/index.html index 89764e28..46a16148 100644 --- a/public/index.html +++ b/public/index.html @@ -90,7 +90,7 @@ - +