Audio format flags.
Defined in <SDL3/SDL_audio.h>
typedef Uint16 SDL_AudioFormat;
#define SDL_AUDIO_U8 0x0008u /**< Unsigned 8-bit samples */
#define SDL_AUDIO_S8 0x8008u /**< Signed 8-bit samples */
#define SDL_AUDIO_S16LE 0x8010u /**< Signed 16-bit samples */
#define SDL_AUDIO_S16BE 0x9010u /**< As above, but big-endian byte order */
#define SDL_AUDIO_S32LE 0x8020u /**< 32-bit integer samples */
#define SDL_AUDIO_S32BE 0x9020u /**< As above, but big-endian byte order */
#define SDL_AUDIO_F32LE 0x8120u /**< 32-bit floating point samples */
#define SDL_AUDIO_F32BE 0x9120u /**< As above, but big-endian byte order */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SDL_AUDIO_S16 SDL_AUDIO_S16LE
#define SDL_AUDIO_S32 SDL_AUDIO_S32LE
#define SDL_AUDIO_F32 SDL_AUDIO_F32LE
#else
#define SDL_AUDIO_S16 SDL_AUDIO_S16BE
#define SDL_AUDIO_S32 SDL_AUDIO_S32BE
#define SDL_AUDIO_F32 SDL_AUDIO_F32BE
#endif
These are what the 16 bits in SDL_AudioFormat currently mean... (Unspecified bits are always zero).
++-----------------------sample is signed if set
||
|| ++-----------sample is bigendian if set
|| ||
|| || ++---sample is float if set
|| || ||
|| || || +=--sample bit size--++
|| || || || ||
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
There are macros to query these bits.
This datatype is available since SDL 3.0.0.