Skip to content

Add microphone cutoff option#15

Open
sandstorm244 wants to merge 1 commit into
SableClient:livekitfrom
sandstorm244:livekit
Open

Add microphone cutoff option#15
sandstorm244 wants to merge 1 commit into
SableClient:livekitfrom
sandstorm244:livekit

Conversation

@sandstorm244

Copy link
Copy Markdown

Content

Adds a user-configurable microphone cutoff volume (noise gate): mic input quieter than a chosen dBFS threshold is muted before being published.

  • New gate stage in the existing RNNoise AudioWorklet (level-based, with hysteresis, ~300ms hold and open/close gain smoothing) — works with RNNoise enabled or disabled
  • New Audio settings section: enable checkbox + cutoff slider (−60…−10 dB, default −40 dB)
  • The slider doubles as a live input meter fed by the worklet's own level measurement — green while above the cutoff (transmitting), grey while below (muted) — so the meter and gate are calibrated identically
  • Threshold changes apply live via worklet messages; no track restart needed. Gate-only mode lifts the 48kHz sample-rate requirement (that's RNNoise-specific)

Motivation and context

Because noise supression just isnt enough, a cut-off helps quite alot.
Similar PR upstream got closed for some reason perhaps we can have this nice feature here?

Screenshots / GIFs

image

Tests

  • 16 new unit tests: gate DSP through the worklet test harness (mutes below cutoff, passes above, hold window, reopen timing, level reporting), processor config plumbing, Publisher attach/detach/live-update, settings UI
  • Manually against the local devenv backend: two participants, one muted + listening; tuned the cutoff with the live meter, confirmed speech cuts out above threshold, background noise (tapping on a can lol/keyboard) muted at −40 dB, word endings not clipped
  • Verified with RNNoise on and off, and that disabling the cutoff removes the processor entirely
  • lint:types, lint:oxlint, lint:knip, format:check, i18n:check, build:full, build:embedded all pass

For transparency sake, i have used AI in this PR.

Feel free to adjust or close if there is a better implementation.

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