01
A real-time audio pipeline that stays off the main thread
- Problem
- Driving a visualization from microphone levels on the main thread competes with React renders — the meter stutters exactly when the user is speaking into it.
- Decision
- Microphone input runs through an AudioWorklet that computes level data off the main thread and posts it at a fixed cadence; the visualization (React Three Fiber) consumes that stream and never touches the raw audio graph.
- Tradeoff
- The worklet adds a build artifact and a message-passing boundary to debug — level data has to be reduced before it crosses, which means the visualization sees processed levels, not raw samples.
- Outcome
- The visualization moves with the voice, through model-time pauses and long answers, without stealing render time from the conversation UI.
