dxx-rebirth/similar/arch/sdl
Kp 9fd0cc96a5 Use correct coefficient table for 11Khz sounds
The new resampler sets upFactor to either `2` (for 22Khz sounds) or
`4` (for 11Khz sounds).  However, the logic to pick which coefficient
table to use tested for `0` versus non-zero, so it always picked the
coefficient table meant for 22Khz sounds, even when the sample was an
11Khz sound.  This caused a high pitched ringing in sampled sounds.
Switch to use an `enum class` to prevent using zero-vs-nonzero tests
without a cast.  Change the existing test to test for the 22Khz `enum`
value, as originally intended.  In testing, this eliminated the ringing
effect in 11Khz sounds.

Identified-by: Chris <https://forum.zdoom.org/viewtopic.php?p=1234989> (in response to a request by KynikossDragonn)
Fixes: 5165efbc46 ("Use custom fixed-point audio resampler: - Hopefully fixes issues with poor quality resampling when using SDL_AudioCVT - Converts 11025 Hz or 22050 Hz samples to the default 44100 Hz outputs - Uses high order brick wall filter like Sound Blaster 16")
2023-01-08 14:19:52 +00:00
..
digi.cpp Hold digi_sample_rate const 2023-01-07 22:17:31 +00:00
digi_audio.cpp Use enum class for sound_sample_rate 2023-01-07 22:17:31 +00:00
digi_mixer.cpp Use correct coefficient table for 11Khz sounds 2023-01-08 14:19:52 +00:00
gr.cpp Use RAII_SDL_Surface to track SDL-only main canvas surface 2022-11-06 18:18:57 +00:00
init.cpp
jukebox.cpp Store ranges::subrange in m3u_bytes 2022-12-31 16:21:47 +00:00