SDL_AUDIO_ISINT(3)

✨ SDL_AUDIO_ISINT ✨

okay bestie, so SDL_AUDIO_ISINT is literally the vibe-check for your audio format πŸ’– it tells you whether an SDL_AudioFormat is giving integer data or not. that's it. that's the whole job. and it does it flawlessly. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_audio.h>

#define SDL_AUDIO_ISINT(x)           (!SDL_AUDIO_ISFLOAT(x))

like look at her. one line. no notes. she's not doing extra, she's not doing less, she's just out here negating SDL_AUDIO_ISFLOAT and living her truth. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, for example β€” and I need you to sit with this β€” SDL_AUDIO_ISINT(SDL_AUDIO_F32) returns 0. yeah. 0. because SDL_AUDIO_F32 is a float format, so it's not int, so it gets a big fat zero. not me double-checking that and being like "wait that tracks actually" 😭


πŸŽ€ MACRO PARAMETERS πŸŽ€

  • x β€” an SDL_AudioFormat value. that's the thing you're asking about. hand her over, she'll tell you what's up. 🫢

⭐ RETURN VALUE ⭐

returns non-zero if the format is integer, and zero otherwise. so like. truthy = int, falsy = not int. classic. iconic. no cap. πŸ”₯


🧚 THREAD SAFETY 🧚

go off, honestly β€” it is safe to call this macro from any thread. every thread. all the threads. simultaneously. she does not care. she was built for this. 🌈


πŸ’œ AVAILABILITY πŸ’œ

this macro has been around since SDL 3.2.0. so if you're on something older... girl. upgrade. πŸ™ˆ


fr fr bestie, the whole thing is a one-line negation of SDL_AUDIO_ISFLOAT, so don't overthink it. just vibe. πŸ“

Simple Directmedia Layer πŸ¦‹ SDL 3.4.18 β€” mwah, that's the whole page, thanks for coming to my TED talk, ily, go write some audio code πŸ’–βœ¨πŸŽ€πŸ’…πŸ‘‘

πŸ“¦ where this page comes from