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

Expose custom configuration of internal AEC3 #44

Open
wants to merge 1 commit into
base: upgrade-v1
Choose a base branch
from

Conversation

skywhale
Copy link
Member

@skywhale skywhale commented Jan 10, 2025

This PR exposes some internals of the EchoCanceller3.

It's not as clean as I hope, as EchoCanceller3 isn't part of the public API of the underlying library, whereas EchoCanceller3Config is, and some C/C++ dance was necessary to make the build happy. I will later look into forking the upstream repo and more properly exposing EchoCanceller3.

EchoCanceller3Config has so many parameters, and none of them are documented unfortunately. I've no idea which parameters are useful exposing and tweaking, so I just randomly started with num_filters, which I assumed is the number of linear regression filters.

@skywhale skywhale force-pushed the upgrade-v1-aec3-tuning branch from cf4c5af to fddf41d Compare January 10, 2025 16:40
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.

Looks good so far, though I suppose this is still draft with more settings to be added?

Update: oh I see that #45 adds to this PR

Comment on lines +39 to +43
webrtc::EchoCanceller3Config build_aec3_config(const EchoCanceller3ConfigOverride& override) {
webrtc::EchoCanceller3Config config;
config.delay.num_filters = override.num_filters;
return config;
}
Copy link
Member

Choose a reason for hiding this comment

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

Supernit: override seems to be a C++ keyword (as GitHub highlights it and as I rembember). Even though it compiles, it may be better can name it differently:

Suggested change
webrtc::EchoCanceller3Config build_aec3_config(const EchoCanceller3ConfigOverride& override) {
webrtc::EchoCanceller3Config config;
config.delay.num_filters = override.num_filters;
return config;
}
webrtc::EchoCanceller3Config build_aec3_config(const EchoCanceller3ConfigOverride& config_override) {
webrtc::EchoCanceller3Config config;
config.delay.num_filters = config_override.num_filters;
return config;
}

Comment on lines +75 to +79
/// Initializes internal states, while retaining all user settings. This should be called before
/// beginning to process a new audio stream. However, it is not necessary to call before processing
/// the first stream after creation.
pub fn initialize(&mut self) {
self.inner.initialize()
Copy link
Member

Choose a reason for hiding this comment

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

Nice, I guess the idea is we could use this from our portal code?

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