MIX_GetAudioDecoderFormat(3)

πŸ“¦
version 3.2.4 Β· 2 versions
, in fedora 44

πŸ’– 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