izzyreal / mpc

mpc2000xl emulator static library
GNU General Public License v3.0
73 stars 8 forks source link

Fix stereo resampling #199

Closed izzyreal closed 12 months ago

izzyreal commented 1 year ago

When loading a WAV of unsupported samplerate, it will be resampled. Moreover, there is the native MPC2000XL functionality to resample.

In both cases, stereo sample data is treated as mono by libsamplerate. Since the sampledata is not interleaved, there is only the problem of not resetting the resampler state at the point where the left channel data ends and the right channel data begins.

But of course this is bad and incorrect enough. However, we can't just pass the number of channels to libsamplerate, because the sampledata is interleaved. So we must process stereo sampledata twice -- once for the left channel, and once for the right channel.

izzyreal commented 12 months ago

Resolved in a92ca898b335c470b2edd12753c5bd5854ce09be