libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
424 stars 145 forks source link

SDL_mixer uses SDL_MixAudio #106

Open SDLBugzilla opened 3 years ago

SDLBugzilla commented 3 years ago

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é!

slouken commented 2 years ago

@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.

icculus commented 2 years ago

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.

slouken commented 2 years ago

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.