Audio: debug logs to trace why packets aren't playing

This commit is contained in:
you
2026-03-22 09:33:47 +00:00
parent a7e8a70c2f
commit 6b8e4447c0
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -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 = [];
+1 -1
View File
@@ -90,7 +90,7 @@
<script src="nodes.js?v=1774126708" onerror="console.error('Failed to load:', this.src)"></script>
<script src="traces.js?v=1774135052" onerror="console.error('Failed to load:', this.src)"></script>
<script src="analytics.js?v=1774126708" onerror="console.error('Failed to load:', this.src)"></script>
<script src="audio.js?v=1774171793" onerror="console.error('Failed to load:', this.src)"></script>
<script src="audio.js?v=1774172027" onerror="console.error('Failed to load:', this.src)"></script>
<script src="live.js?v=1774171793" onerror="console.error('Failed to load:', this.src)"></script>
<script src="observers.js?v=1774290000" onerror="console.error('Failed to load:', this.src)"></script>
<script src="observer-detail.js?v=1774028201" onerror="console.error('Failed to load:', this.src)"></script>