feat: add ALSA audio capturer and refactor audio capturing architecture#329
Merged
TzuHuanTai merged 2 commits intomainfrom May 3, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an ALSA-based audio capturer and refactors the audio capture pipeline behind a shared AudioCapturer abstraction, with runtime fallback from PulseAudio to ALSA when initializing WebRTC’s audio backend.
Changes:
- Introduce
AudioCapturer/AudioBufferinterface and migrate recorder + conductor to use it. - Add
AlsaCapturerimplementation and select it when PulseAudio ADM initialization fails. - Remove legacy
Pa2Capturerand update build to link ALSA.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rtc/conductor.h | Switch conductor audio source type to AudioCapturer and track ALSA usage. |
| src/rtc/conductor.cpp | Add PulseAudio→ALSA fallback for WebRTC ADM and choose matching capturer. |
| src/recorder/recorder_manager.h | Update recorder API to accept AudioCapturer sources. |
| src/recorder/recorder_manager.cpp | Adjust audio recorder creation/subscription to AudioBuffer. |
| src/recorder/audio_recorder.h | Migrate recorder template parameter from PaBuffer to AudioBuffer. |
| src/recorder/audio_recorder.cpp | Update OnBuffer implementation to consume AudioBuffer. |
| src/capturer/pa_capturer.h | Refactor PulseAudio capturer to implement AudioCapturer. |
| src/capturer/pa_capturer.cpp | Update PulseAudio factory/ctor and keep emitting AudioBuffer. |
| src/capturer/pa2_capturer.h | Remove legacy PulseAudio capturer variant. |
| src/capturer/pa2_capturer.cpp | Remove legacy PulseAudio capturer variant implementation. |
| src/capturer/audio_capturer.h | New audio capturer abstraction and shared buffer type. |
| src/capturer/alsa_capturer.h | New ALSA capturer header. |
| src/capturer/alsa_capturer.cpp | New ALSA capturer implementation with sample format conversion to float. |
| src/capturer/CMakeLists.txt | Add ALSA source + pkg-config dependency and link settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
4cb121f to
cf911e7
Compare
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.
No description provided.