Repository navigation
Commit aaef1cc
Fix microphone intermittently missing wave fronts (#34)
The microphone detected a wave only when a front was momentarily within a
fixed ±2 m band of it. At the sound speed of 343 m/s, an expanding front
advances ~5.7 m per frame at 60 fps — wider than the 4 m band — so the front
frequently steps over the microphone between frames and is never detected,
producing no click sound. This was only reliable at SLOW time speed.
detectWaveAt now detects the front *crossing* the microphone during a step
(previous radius < distance <= current radius), using the step's modelDt to
know how far the front advanced. The static tolerance is kept as a fallback
for the dt ~ 0 (paused/single-step) case. Added tests covering the fast-front
crossing, the no-detect-before-arrival case, and the cooldown.
Claude-Session: https://claude.ai/code/session_01LVWd98n2jxyMFC6fDPVvjN
Co-authored-by: Claude <noreply@anthropic.com>1 parent df75b33 commit aaef1cc
0 file changed
0 commit comments