Skip to content

feat: audio pipeline noise gate for VCS pre-processing#6

Draft
cloudygetty-ai wants to merge 2 commits into
mainfrom
claude/audio-pipeline-noise-gate-cpEMM
Draft

feat: audio pipeline noise gate for VCS pre-processing#6
cloudygetty-ai wants to merge 2 commits into
mainfrom
claude/audio-pipeline-noise-gate-cpEMM

Conversation

@cloudygetty-ai

Copy link
Copy Markdown
Owner

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. Exposes engage(), calibrate(), stop(), subscribe(), and getOutputNode() (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 → ACTIVE
  • gateOpen is false in ambient silence, true when speaking above the calibrated threshold
  • calibrate() can be re-triggered while active; threshold updates in the compressor node
  • stop() halts all mic tracks and resets state to OFFLINE
  • Mic permission denied → status error with message
  • getOutputNode() returns the gain node; piping it into a MediaRecorder captures the gated audio

Generated by Claude Code

- 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
@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
anl Ready Ready Preview, Comment May 16, 2026 10:06pm

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant