Skip to content

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.

3 participants