Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade webrtc-audio-processing lib to v2.0 #43

Open
wants to merge 3 commits into
base: upgrade-v1
Choose a base branch
from

Conversation

skywhale
Copy link
Member

@skywhale skywhale commented Jan 10, 2025

It builds, but functionalities haven't been tested.

Copy link
Member

@strohel strohel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a pass by review, looks good on paper

Comment on lines +103 to +118
impl From<CaptureLevelAdjustment> for ffi::AudioProcessing_Config_CaptureLevelAdjustment {
fn from(other: CaptureLevelAdjustment) -> Self {
let analog_mic_gain_emulation =
ffi::AudioProcessing_Config_CaptureLevelAdjustment_AnalogMicGainEmulation {
enabled: false,
initial_level: 255,
};

Self {
enabled: true,
pre_gain_factor: other.pre_gain_factor,
post_gain_factor: other.post_gain_factor,
analog_mic_gain_emulation,
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional nit: we could instead implement impl From<Option<CaptureLevelAdjustment>> for ffi::AudioProcessing_Config_CaptureLevelAdjustment { and set enabled: false if it is None - i.e. move some logic from the caller to here.

OTOH I guess this pattern is used for many types here, so we shuold probably either convert either all or none - which is better suited for a separate PR.

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.

2 participants