New resampler: audible aliasing when upsampling 11k or 22k audio #2663
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Comments on the original bug report:
On 2017-10-12 19:27:12 +0000, Eric Wasylishen wrote:
On 2017-11-11 18:20:55 +0000, Eric Wasylishen wrote:
On 2018-02-17 23:10:47 +0000, Ryan C. Gordon wrote:
On 2018-02-21 21:03:49 +0000, Eric Wasylishen wrote:
On 2018-02-21 21:12:25 +0000, Sam Lantinga wrote:
On 2018-02-22 11:08:10 +0000, Eric Wasylishen wrote:
On 2018-02-22 18:43:20 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered:
I've managed to statically link libsamplerate into my project and I can see how it gets loaded when stepping through the code during initialization (LoadLibSampleRate). However the problem is still here. Still very audible noise and crackling.
Oh, I see what's happening now.
SDL_sound is still using the SDL_AudioCVT API for resampling, and this API does not work to resample data in chunks (it was all we had at the time)...I haven't heard your results, but it's not uncommon for it to produce audio artifacts on the edges of the data that you feed it, because it doesn't know about samples before and after the chunk to interpolate them properly.
Nowadays SDL has SDL_AudioStream, which can resample data as it passes through a queue. SDL_sound will be moving to this soon, but hasn't yet.
My suspicion is this is the exact problem and it's clear what the fix needs to be.
(SDL_AudioCVT doesn't use libsamplerate, just SDL_AudioStream, but your problem will likely go away with or without libsamplerate, once we start using a proper stream. Sorry for the confusion and extra work I caused you here.)