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β anSDL_AudioFormatvalue. 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
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms