Fix #623: Adaptive noise gate with dynamic noise floor estimation#821
Fix #623: Adaptive noise gate with dynamic noise floor estimation#821Shan7Usmani wants to merge 2 commits into
Conversation
|
Warning Review limit reached
More reviews will be available in 59 minutes and 52 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Thank You for Contributing to Late-MeetPlease ensure that:
Thank you for contributing 💙 |
|
👋 Thank you @Shan7Usmani for your contribution to Late-Meet! ✅ Verified: You are assigned to the linked issue #623. Please review any automated suggestions or code review comments that may appear below! We will review your PR as soon as possible! Please consider starring the repository ⭐ to show your support! |
…imation
- Add AdaptiveNoiseGate class to src/audioProcessing.ts:
- Estimates background noise floor from incoming RMS samples
- Computes adaptive threshold = noiseFloor × multiplier (clamped)
- Hold counter prevents gate chatter during inter-word pauses
- Noise floor adapts upward during silence, decays slowly during speech
- Integrate into offscreen.ts VAD loop:
- Replace fixed rmsThreshold with adaptive threshold from noise gate
- Control a GainNode that physically attenuates silent passages before
they reach the MediaRecorder, reducing STT API costs
- Smooth gain ramps via setTargetAtTime (10ms time constant) to avoid clicks
- Tick hold counter on every VAD cycle (even throttled ticks)
- Modify offscreenAudioGraph.ts:
- Add noiseGateGain (GainNode) to OffscreenAudioGraph interface
- Route sources through gain node → recorder destination (gated path)
- Analyser and playback always receive raw ungated signal
- Add noise gate constants to config.ts
- Add 14 unit tests for AdaptiveNoiseGate in audioProcessing.test.ts
- Update 2 offscreen graph tests for new gain node topology
- Fix noise floor decay toward zero during speech (long-meeting bug) → noise floor is now untouched during speech, stays at last silence estimate - Fix reset() ignoring constructor options → stores initialThreshold and restores it - Remove unused frameCount field - Rename process() → analyze() for clarity - Remove gain ramp guard with arbitrary 0.01 tolerance (setTargetAtTime is idempotent) - Update/add tests to verify fix behavior
9a74105 to
687f399
Compare
|
|
@shouri123 this PR (#821 - adaptive noise gate) is rebased on latest main with all checks passing. Could you please review it as it has been there for days? Thanks! |
|
@shouri123 please review the pr , i have 4 pr waiting to be merged from this project |
|
This PR has been marked as stale due to inactivity. |



Description
Implements an adaptive noise gate that dynamically estimates the background noise floor from incoming audio and adjusts the gating threshold in real time. Low-amplitude ambient noise (fans, keystrokes, background chatter) is physically attenuated before it reaches the MediaRecorder, reducing Whisper STT API costs.
Fixes #623
Type of Change
Checklist:
Implementation
AdaptiveNoiseGate class (src/audioProcessing.ts)
Integration
Tests