andrei-drexler / ironwail

High-performance QuakeSpasm fork
GNU General Public License v2.0
481 stars 43 forks source link

[Feature Request] Improved audio up-sampling #239

Open 4LT opened 11 months ago

4LT commented 11 months ago

Currently, setting sndspeed to 44100 (or anything other than 11025) results in up-sampling by "holding" each input 11025 Hz sample for 4 samples (or each input 22050 Hz sample for 2 samples). This results in some undesirable high-frequency noise.

Better methods exist, such as sinc interpolation. I've heard that this method is what's used when setting sndspeed to 11025: hold the samples as before, and apply a low-pass filter; however, when setting sndspeed >11025, the effect should be that the low-pass filter is applied before mixing and only to the low-sample-rate audio.