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β anSDL_AudioFormatvalue. 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
- 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