MIX_GetAudioDecoderFormat(3)
π MIX_GetAudioDecoderFormat π
okay so bestie, we're in the SDL_mixer3 functions section, and today's main character is MIX_GetAudioDecoderFormat(3). she's giving "let me peek at your initial audio format real quick" energy and honestly? we're obsessed. π
β¨ NAME β¨
MIX_GetAudioDecoderFormat β ask a MIX_AudioDecoder what its initial audio format is. that's it, that's the vibe check. π
πΈ SYNOPSIS πΈ
#include <SDL3_mixer/SDL_mixer.h>
bool MIX_GetAudioDecoderFormat(MIX_AudioDecoder *audiodecoder, SDL_AudioSpec *spec);
like, she takes two things and gives you back a bool. no cap. β¨
π¦ DESCRIPTION π¦
so here's the tea, bestie. some audio files can <em>change format in the middle</em>. some of them explicitly support doing that, and then there's the more common little gremlin example: two MP3 files concatenated together. π
and in many cases, SDL_mixer will correctly handle these sort of files! she's talented like that. but β and this is the important part β this function will only report the initial format a file uses. just the opening act. the first fit. not the whole character arc. π
π«Ά FUNCTION PARAMETERS π«Ά
audiodecoderβ the audio decoder you wanna query. the one we're asking. πspecβ on success, the audio format details get stored in here. she fills this in for you. so cute.
β RETURN VALUE β
Returns true on success, or false on failure. and if it fails? call SDL_GetError() for more info, because she <em>will</em> tell you what went wrong. π£
π THREAD SAFETY π
It is safe to call this function from any thread. yes bestie, any thread. go wild. π§
π AVAILABILITY π
This function is available since SDL_mixer 3.0.0. she's been here. she's iconic. she's not new. π
lowkey reminder: this only ever gives you the initial format, so if your file is doing a format glow-up halfway through, don't come for her β she told you upfront. π
that's the whole page, bestie, ate and left no crumbs. this was MIX_GetAudioDecoderFormat(3) from SDL_mixer 3.2.4 β mwah, love u, go read your audio specs. πβ¨π¦
π¦ where this page comes from
- fedora 44: SDL3_mixer-doc 3.2.4-3.fc44 Β· Zlib AND (GPL-2.0-or-later OR LGPL-2.0-or-later)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms