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

Revamp interpolation quality for resampling #7243

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

sakertooth
Copy link
Contributor

When resampling audio, it was common for us to:

  1. Use the SRC_LINEAR converter type only
  2. Have no reasonable way to change this in the user settings
  3. Have no way to ensure that the type specified was consistent across all our clients that use SRC_STATE to resample.

This PR addresses these concerns by:

  1. Move all owners of raw SRC_STATE's to use the AudioResampler libsamplerate wrapper
  2. Make the interpolation function in the export dialog actually apply for every AudioResampler
  3. Allow the user to specify the interpolation mode that they wish to use on playback.

This also addresses the issue where pitch bending would cause major aliasing and audible "crackles" since linear interpolation was being used. The user can now choose an appropriate interpolation mode to avoid this from happening.

The functions in interpolation.h could've been used for this, but it was simpler to continue using libsamplerate for the time being, though it may be worth exploring the use of these functions instead of libsamplerate in the future. The code that currently uses these for resampling were left alone (e.g., VibratingString::resample was untouched).

@sakertooth
Copy link
Contributor Author

I'm going to try and remove libsamplerate from this as well and use the functions within interpolation.h. I also don't know if we should even have a linear option anymore, given the aliasing that it brings to the audio.

@sakertooth sakertooth marked this pull request as draft May 7, 2024 11:43
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.

None yet

1 participant