You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps I'm missing something but when doing some changes on the ancient SDL_mixer 1.2, I have noticed that its mix_channels function calls SDL_MixAudio.
As we can read in the original 1.2 docs: Do not use this function for mixing together more than two streams of sample data. The output from repeated application of this function may be distorted by clipping, because there is no accumulator with greater range than the input (not to mention this being an inefficient way of doing it). Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead. (that reference to SDL_mixer itself is quite interesting in this context...)
To my surprise, this called stayed there even to this date:
Perhaps I'm missing something but when doing some changes on the ancient SDL_mixer 1.2, I have noticed that its
mix_channels
function callsSDL_MixAudio
.As we can read in the original 1.2 docs: Do not use this function for mixing together more than two streams of sample data. The output from repeated application of this function may be distorted by clipping, because there is no accumulator with greater range than the input (not to mention this being an inefficient way of doing it). Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead. (that reference to SDL_mixer itself is quite interesting in this context...)
To my surprise, this called stayed there even to this date:
SDL_mixer/src/mixer.c
Line 440 in 1bf7a79
while SDL3's SDL_MixAudio still warns about not using it for more than two channels.
Considering that SDL_mixer supports up to 8 channels:
SDL_mixer/include/SDL3_mixer/SDL_mixer.h
Line 184 in 1bf7a79
shouldn't this be rewritten into a custom mixing code for better efficiency / accuracy?
The text was updated successfully, but these errors were encountered: