We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3956

Summary: New resampler: ResamplerPadding issues (too large)
Product: SDL Reporter: Eric Wasylishen <ewasylishen>
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.7   
Hardware: x86   
OS: Other   

Description Eric Wasylishen 2017-11-11 18:49:13 UTC
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.)