Skip to content

feat: AGC2 adaptive digital gain in realtime microphone processing - #15

Merged
tiredIsa merged 1 commit into
native-v2from
feat/realtime-agc2
Oct 12, 2026
Merged

tiredIsa merged 1 commit into
native-v2from
feat/realtime-agc2

Conversation

@tiredIsa

@tiredIsa tiredIsa commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

For syrnike13-app issue #165: replace the application's hand-written gain with WebRTC AGC2.

  • RealtimeAudioProcessing::processGain() — one 10 ms frame through a prewarmed APM with gain_controller2.adaptive_digital (C ABI in livekit-ffi/src/realtime_apm.rs).
  • Separate from process() so the caller can take its gate measurement after AEC/NS and before gain. process() is unchanged.

Verification (local, Windows): cargo test -p livekit-ffi --lib realtime_apm::tests (2), ctest -R AudioProcessingModuleTest (33, incl. a test that quiet speech-like input is raised). App-side offline measurement with SAPI speech: quiet mic -27 → -22 dBFS, SNR unchanged.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

RealtimeAudioProcessing gets a third prewarmed WebRTC processor with
gain_controller2.adaptive_digital, reachable through processGain(). It is a
separate call so the application can measure its own gate level after
AEC/NS and before gain. AEC and NS processing is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tiredIsa
tiredIsa merged commit 2856a43 into native-v2 Oct 12, 2026
@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9ac564a9-b177-4fbc-b43b-e00fa924a47b

📥 Commits

Reviewing files that changed from the base of the PR and between f9e9908 and bbd8864.


📒 Files selected for processing (5)
  • docs/realtime-microphone-dsp.md
  • include/livekit/realtime_audio_processing.h
  • patches/client-sdk-rust/0001-native-v2-runtime.patch
  • src/realtime_audio_processing.cpp
  • src/tests/unit/test_audio_processing_module.cpp

 _____________________________________________________________________________________________________________
< Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. >
 -------------------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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