From fa3fa2e4add51e20b4daad1de4f48892850ccf3a Mon Sep 17 00:00:00 2001 From: Moepchi Date: Sat, 3 Oct 2026 09:24:28 +0000 Subject: [PATCH] chore: temporary diagnostics when shared audio stays silent Measures the captured track directly, next to the mixer's view, to tell a silent capture apart from a mixing bug (Edge + Windows system audio report). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU --- web/src/App.tsx | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index 9e47767..0aca421 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -8739,9 +8739,24 @@ function AppInner() { setTabAudioOn(true); // Windows system audio only covers the default output device; music on // another device arrives as pure silence, with nothing else to tell why. - setTimeout(() => { - if (tabAudioRef.current === stream && micCaptureRef.current && micCaptureRef.current.extraPeak < 1e-4) - appendLog({ text: t("tabAudio.silent"), kind: "error" }); + setTimeout(async () => { + if (tabAudioRef.current !== stream || !micCaptureRef.current || micCaptureRef.current.extraPeak >= 1e-4) return; + appendLog({ text: t("tabAudio.silent"), kind: "error" }); + // ponytail: temporary diagnostics - tells "browser delivers silence" + // apart from "the mixer loses it"; drop once the Edge report is solved. + const probe = new AudioContext(); + void probe.resume(); + const analyser = probe.createAnalyser(); + probe.createMediaStreamSource(new MediaStream([track])).connect(analyser); + await new Promise((r) => setTimeout(r, 1500)); + const data = new Float32Array(analyser.fftSize); + analyser.getFloatTimeDomainData(data); + const direct = data.reduce((m, v) => Math.max(m, Math.abs(v)), 0); + appendLog({ + text: `Diag: direct=${direct.toFixed(5)} mixer=${micCaptureRef.current?.extraPeak.toFixed(5)} muted=${track.muted} state=${track.readyState} enabled=${track.enabled} probe=${probe.state} settings=${JSON.stringify(track.getSettings())}`, + kind: "error", + }); + void probe.close(); }, 5000); };