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

fix: Audio clicks/pops when adjusting Freeverb filter parameters and changing waveform frequency #156

Closed
sbauly opened this issue Nov 30, 2024 · 4 comments · Fixed by #158
Labels
bug Something isn't working

Comments

@sbauly
Copy link

sbauly commented Nov 30, 2024

Description

Audible artifacts (clicks and pops) can be heard when modifying audio parameters in real-time. This is particularly noticeable with Freeverb's wetness parameter, but can also be heard when adjusting a generated waveform's frequency.

Steps To Reproduce

  1. Adjust the frequency slider in the waveform example, or play any sound with the Freeverb filter and adjust the wetness during playback.
  2. Hear the clicks and pops in audio as the frequency or wetness is adjusted
  3. Many pops can be heard when dragging a slider (rapidly adjusting a parameter), but singular pops can also be heard when tapping just once to adjust a parameter. This is especially noticeable whilst wearing headphones.

Recommendations

It would be great if we could implement smoothing/interpolation when changing filter values to eliminate these artifacts. This would allow for seamless transitions, which is particularly important for immersion in games.

@sbauly sbauly added the bug Something isn't working label Nov 30, 2024
@alnitak
Copy link
Owner

alnitak commented Nov 30, 2024

Hi @sbauly,

I can hear clicks when fast changing the frequency in the waveform example, but not when changing parameters like the wet in the freeverb filter.

I tried on linux, android and web.

I'll try to figure out what wrong.
Thank you.

@sbauly
Copy link
Author

sbauly commented Dec 1, 2024

Hi @alnitak, thank you for your reply!

I threw together a quick example app to demonstrate the issue.

Here is the result of adjusting the wetness parameter on generated waveforms, with audible clicks and pops when adjusting the wetness:

XRecorder_01122024_101154.mp4

Here is the result of adjusting the wetness parameter on an audio file (I tested with .ogg, .wav and .mp3, all were producing pops and clicks):

XRecorder_01122024_103021.mp4

The pops are quieter when adjusting the wet on an audio file, but still noticeable with headphones.

I have been adjusting the wetness as follows:

Center(
              child: Slider(
                value: viewModel.reverbWet,
                onChanged: (value) {
                  viewModel.adjustFreeverbWetness(value);
                },
              ),
            ),
  double _reverbWet = 0.5;
  double get reverbWet => _reverbWet;

  void adjustFreeverbWetness(double wetness) {
    _reverbWet = wetness;
    SoLoud.instance.filters.freeverbFilter.wet.value = wetness;
    notifyListeners();
  }

I've tried using the fadeFilterParameter() method instead of directly setting the wetness value, but have been unable to get it to work yet.

I'm using flutter_soloud: ^2.1.7 from pub.dev, and I can hear these pops on both Android and iOS.

As always, thank you for your amazing hard work on this package!

alnitak added a commit that referenced this issue Dec 5, 2024
fix: clicks and pops when changing waveform frequency #156
@alnitak
Copy link
Owner

alnitak commented Dec 5, 2024

Hey @sbauly,

It was hard, but I think I fixed the waveform clicks and pops.
I didn't find what was wrong about the clicks with the wetness on freeverb. I'll try again.

The #158 has already been merged if you want to give it a try.

@sbauly
Copy link
Author

sbauly commented Dec 5, 2024

Thank you very much @alnitak, I just tested this and the frequencies are changing flawlessly and smoothly!

Regarding Freeverb, I've noticed that increasing the wetness also increases the volume/gain quite dramatically. This is fairly normal behavior with reverb, but is more pronounced when the input is already quite loud. The faster the wetness is adjusted, the more clicks and pops are heard.

I suspect that this is the cause of the pops. Again, this might be something the new limiter and compressor filters in #149 can hopefully help alleviate :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants