feat: audio pipeline noise gate for VCS pre-processing#6
Draft
cloudygetty-ai wants to merge 2 commits into
Draft
feat: audio pipeline noise gate for VCS pre-processing#6cloudygetty-ai wants to merge 2 commits into
cloudygetty-ai wants to merge 2 commits into
Conversation
- src/services/audio/AudioPipelineService.ts: singleton class — mic → 80 Hz HP filter → hard-knee compressor gate → output. Exposes engage(), calibrate(), stop(), and a subscribe() observer pattern. - src/stores/audioPipelineStore.ts: Zustand store mirroring pipeline state (status, gateOpen, gateThresholdDb, isCalibrated, errorMessage) - src/hooks/useAudioPipeline.ts: React hook for components — returns state + action callbacks, auto-stops on unmount
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Resolves pre-existing TypeScript errors in useVideoCall.ts: - useSocket.ts was imported but never existed - services/api.ts was imported but api lives in lib/api.ts
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.
Summary
Adds a Web Audio noise gate pipeline as a pre-processing layer before VCS voice sample capture.
src/services/audio/AudioPipelineService.ts— singleton class. Signal chain: mic → 80 Hz high-pass filter (removes sub-bass rumble that skews pitch analysis) → hard-knee dynamics compressor acting as a noise gate (20:1 ratio, knee 0) → output gain. Auto-calibrates threshold against the ambient noise floor on first engage. Exposesengage(),calibrate(),stop(),subscribe(), andgetOutputNode()(for piping the gated stream into MediaRecorder or the VCS capture chain).src/stores/audioPipelineStore.ts— Zustand store that mirrors all pipeline state (status, gateOpen, gateThresholdDb, isCalibrated, errorMessage) for reactive UI binding.src/hooks/useAudioPipeline.ts— thin React hook; returns store state + actions, stops the pipeline on component unmount.Test plan
engage()triggers mic permission prompt; status transitions OFFLINE → CONNECTING → CALIBRATING → ACTIVEgateOpenisfalsein ambient silence,truewhen speaking above the calibrated thresholdcalibrate()can be re-triggered while active; threshold updates in the compressor nodestop()halts all mic tracks and resets state to OFFLINEerrorwith messagegetOutputNode()returns the gain node; piping it into a MediaRecorder captures the gated audioGenerated by Claude Code