SDL-mirror/src/audio
Sam Lantinga dd27ac6305 Fixed bug 3876 - Resampling of certain sounds adds heavy distortion
Simon Hug

Patch that adds [-1, 1] clamping to the scalar audio type conversions.

This may come from the SDL_Convert_F32_to_X_Scalar functions. They don't clamp the float value to [-1, 1] and when they cast it to the target integer it may be too large or too small for the type and get truncated, causing horrible noise.

The attached patch throws clamping in, but I don't know if that's the preferred way to fix this. For x86 (without SSE) the compiler (I tested MSVC) seems to throw a horrible amount of x87 code in it. It's a bit better with SSE, but probably still quite the performance hit. And SSE2 uses a branchless approach with maxss and minss.
2017-10-18 19:30:47 -07:00
..
alsa alsa: removed snd_pcm_wait() call before writing to playback device. 2017-09-09 21:17:46 -04:00
android Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
arts Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
coreaudio coreaudio: changed device close procedure to prevent long hangs in some cases. 2017-10-13 01:15:29 -04:00
directsound Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
disk diskaudio: Use SDL_Log, not fprintf. 2017-01-05 19:30:45 -05:00
dsp Updated copyright for 2017 2017-01-01 18:33:28 -08:00
dummy Updated copyright for 2017 2017-01-01 18:33:28 -08:00
emscripten Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
esd Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
fusionsound Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
haiku Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
jack Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
nacl Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
nas Removed newlines from error messages. 2017-03-26 21:00:19 +02:00
netbsd Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
paudio Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
psp Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
pulseaudio Removed unused errno includes. 2017-05-27 23:30:07 +02:00
qsa Fixed bug 2330 - Debian bug report: SDL2 X11 driver buffer overflow with large X11 file descriptor 2017-08-14 20:22:19 -07:00
sndio sndio: Patched to compile if SIO_DEVANY isn't defined. 2017-09-02 16:41:14 -04:00
sun Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
wasapi Added WASAPI audio target to autoconf build process 2017-08-18 17:29:44 -07:00
winmm Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
xaudio2 Fixed WinRT build after changing the header guard preprocessor symbol 2017-08-28 01:59:53 -07:00
SDL_audio.c audio: Replaced the resampler. Again. 2017-09-21 02:51:14 -04:00
SDL_audio_c.h Added audio stream conversion functions: 2017-10-18 15:54:05 -07:00
SDL_audiocvt.c Added a staging buffer to the audio stream so that we can accumulate small amounts of data if needed when resampling 2017-10-18 19:26:36 -07:00
SDL_audiodev.c audio: rename bsd target to netbsd. 2017-05-24 19:56:59 -04:00
SDL_audiodev_c.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_audiotypecvt.c Fixed bug 3876 - Resampling of certain sounds adds heavy distortion 2017-10-18 19:30:47 -07:00
SDL_mixer.c Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_sysaudio.h qnx: Removed unused bootstrap declaration. 2017-07-02 22:46:00 +02:00
SDL_wave.c wave: SDL_LoadWAV now supports 24-bit audio. 2017-09-07 10:56:08 -04:00
SDL_wave.h audio: Added basic WAVE_FORMAT_EXTENSIBLE support to .wav loader. 2017-02-17 02:25:37 -05:00