feat(voice): audio-reactive waveform while recording (no live transcript)#634
Merged
Conversation
When recording, the chat input now displays only a live waveform that accumulates from the left and grows to full width, with bar heights driven by real mic amplitude. The transcribed words are still captured and submitted, just not shown while recording. New bars animate in and flow smoothly at ~16 updates/sec.
Normalize each frame's amplitude against a running peak (instant attack, slow release) at capture time and map it with a near-linear curve, so bar heights accurately reflect how loud/soft the voice is regardless of mic gain — replacing the old fixed-gain sqrt curve that saturated near max.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When the mic is active in the chat input, show only a live audio-reactive waveform instead of the transcribed words. The transcript is still captured and submitted on send — it's just not displayed while recording.
Behavior
Implementation
useVoiceMode.ts— compute per-frame RMS in the existing audio-process callback, normalize against a running peak, and expose a capped rolling history viaaudioLevelsRef.chat-input-with-mentions.tsx— rewroteVoiceWaveformto render the live, growing, audio-reactive bars; removed the transcribed-words span from the recording bar.audioLevelsRefthroughApp→ChatSidebar→ChatInputWithMentions→VoiceWaveform.Tuning knobs
PEAK_DECAY/MIN_PEAK(hook) — release speed and silence floor for the auto-gain.WAVE_CURVE,WAVE_BAR_*(component) — height curve and bar sizing.Notes
Transcription pipeline (Deepgram streaming, submit/cancel) is unchanged.