SDL_AUDIO_ISUNSIGNED(3)

πŸ’– SDL_AUDIO_ISUNSIGNED πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, we're doing SDL_AUDIO_ISUNSIGNED today and it's literally the easiest glow-up check in the whole audio header πŸŽ€

✨ NAME ✨

SDL_AUDIO_ISUNSIGNED β€” the lil macro that tells you whether an SDL_AudioFormat is representing unsigned data. that's it. that's the job. she's simple, she's iconic πŸ‘‘


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_audio.h>

#define SDL_AUDIO_ISUNSIGNED(x)      (!SDL_AUDIO_ISSIGNED(x))

no cap, she is one line and she is doing the most with it πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so the vibe here is: you hand her an audio format, she tells you if it's unsigned. and because she's built on top of SDL_AUDIO_ISSIGNED, she's basically just flipping the answer around with a ! like a girl flipping her hair πŸ™ˆ

for example, SDL_AUDIO_ISUNSIGNED(SDL_AUDIO_S16) returns 0. yeah. signed. not unsigned. the math is mathing ⭐

πŸŽ€ MACRO PARAMETERS πŸŽ€

  • x β€” an SDL_AudioFormat value. that's the whole assignment, bestie, just slide her a format and she'll vibe check it for you 🫢

πŸ’œ RETURN VALUE πŸ’œ

returns non-zero if the format is unsigned, and zero otherwise. so like, truthy = unsigned, falsy = not unsigned. she does not do maybes πŸ’€

πŸ”₯ THREAD SAFETY πŸ”₯

it is safe to call this macro from any thread. go wild. every thread. all at once. she's chill like that 😌✨

🌈 AVAILABILITY 🌈

this macro has been available since SDL 3.2.0. if you're on something older, sorry babe, no unsigned check for you 😭


real talk: this is a macro, not a function, so don't go taking her address or anything. just call her and move on πŸ’–

and that's the whole page, gorgeous πŸŽ€ brought to you by the lovely people at Simple Directmedia Layer, shipping with SDL 3.4.18, and catalogued as SDL_AUDIO_ISUNSIGNED(3) in the SDL3 functions manual. mwah, go make some noise πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from