SDL icon indicating copy to clipboard operation
SDL copied to clipboard

audio: SDL_ClosestAudioFormats now favors floating point types.

Open icculus opened this issue 1 year ago • 5 comments

Fixes #9581.

CC @0x1F9F1

icculus avatar May 26 '24 17:05 icculus

We should remove the endian float versions and just use native float format here. Do we need any other formats besides native and float?

slouken avatar May 26 '24 18:05 slouken

I don't know if audio hardware still generally wants littleendian data even when plugged into a bigendian machine (and if the OS hides this detail from the app). I think leave it with float moved up front, but all the byte order options included. If we don't need the extra byte orders, worst case is a few extra tests when opening a physical audio device.

icculus avatar May 26 '24 19:05 icculus

Okay, sounds good.

slouken avatar May 26 '24 19:05 slouken

Yeah I feel like you'd want to prefer native > swapped endian, rather than little > big, since most OSs will be mixing the audio with other apps, even if the actual hardware prefers little.

0x1F9F1 avatar May 26 '24 20:05 0x1F9F1

Yeah I feel like you'd want to prefer native > swapped endian

Agreed. I'll fix that up, and then I think this will be good to go.

icculus avatar May 27 '24 17:05 icculus

Sorry for the delay on this PR. This now favors float32 types, and the native byte order over byteswapped versions for all types.

If this looks okay, go ahead and click merge!

icculus avatar Jul 31 '24 06:07 icculus

Merged!

slouken avatar Jul 31 '24 14:07 slouken