SDL
SDL copied to clipboard
New resampler: ResamplerPadding issues (too large)
This bug report was migrated from our old Bugzilla tracker.
Reported in version: 2.0.7 Reported for operating system, platform: Other, x86
Comments on the original bug report:
On 2017-11-11 18:49:13 +0000, Eric Wasylishen wrote:
Two issues:
- ResamplerPadding is using RESAMPLER_SAMPLES_PER_ZERO_CROSSING=512 - I think this should be RESAMPLER_ZERO_CROSSINGS=5. ie: 512 is the "oversampling factor" for the full filter table, so linear interpolation on it will work. But 5 is the actual size of the interpolated kernel that SDL_ResampleAudio uses.
Fixing this should remove 11ms of audio latency assuming input is 44100Hz, I think?
- The "if (inrate > outrate)" part is related to the part of the "band-limited resampling" paper that says - "if rho < 1... the step-size through the filter table is reduced.." i.e. about lowering the cutoff frequency based on the output sample rate. However this is not implemented in SDL_ResampleAudio so I would just delete it until it is. (I just filed https://bugzilla.libsdl.org/show_bug.cgi?id=3955 about that.)