SDL_mixer icon indicating copy to clipboard operation
SDL_mixer copied to clipboard

SDL_mixer uses SDL_MixAudio

Open SDLBugzilla opened this issue 4 years ago • 3 comments

This bug report was migrated from our old Bugzilla tracker.

Reported in version: unspecified Reported for operating system, platform: Other, x86

Comments on the original bug report:

On 2012-01-01 13:32:14 +0000, Dag Ågren wrote:

The function SDL_MixAudio has this note in the documentation:

Note: 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.

This seems entirely reasonable. However, SDL_mixer still seems to use this function for all its mixing despite it being documented to not be suitable for this purpose (and SDL_mixer itself being recommended as an alternative!)

On 2017-10-21 22:25:47 +0000, Sam Lantinga wrote:

Touché!

SDLBugzilla avatar Feb 11 '21 05:02 SDLBugzilla

@icculus, this is still true. Do you think we should switch to float or 32-bit int for internal mixing at this point? Either way we'd change the performance of the function, but devices are fast enough that it's probably worth the time to be correct.

slouken avatar May 20 '22 18:05 slouken

Do you think we should switch to float or 32-bit int for internal mixing at this point?

Yes, let's move to float, and maybe int for the PSP, etc. Assign this to me unless you really want to do it.

icculus avatar May 20 '22 19:05 icculus

If you want to try to make this change for this release, I'm fine with that, just move the milestone to 2.6.0.

slouken avatar May 20 '22 20:05 slouken