MIX_DecodeAudio(3)
β¨ MIX_DecodeAudio(3) β¨
okay bestie, welcome to the SDL_mixer3 pages, this one's literally called MIX_DecodeAudio and it's giving "give me more audio bytes, queen" energy π
πΈ NAME πΈ
MIX_DecodeAudio β Decode more audio from a MIX_AudioDecoder. π
π¦ SYNOPSIS π¦
#include <SDL3_mixer/SDL_mixer.h>
int MIX_DecodeAudio(MIX_AudioDecoder *audiodecoder, void *buffer, int buflen, const SDL_AudioSpec *spec);
no cap, that's the whole vibe right there β¨
π DESCRIPTION π
So here's the tea: data is decoded on demand in whatever format is requested. and like, the format is permitted to change between calls?? iconic behavior honestly. slay π«Ά
This function will return the number of bytes decoded, which may be less than requested if there was an error or end-of-file. yep, she can under-deliver (for very valid reasons tho, not her fault).
A return value of zero means the entire file was decoded. a return value of -1 means an unrecoverable error happened π that one's the bad ending fr fr.
π FUNCTION PARAMETERS π
audiodecoderβ the decoder from which to retrieve more data. your main character, the source of the goods πbufferβ the memory buffer to store decoded audio. this is where the bytes go to live β¨buflenβ the maximum number of bytes to store tobuffer. hard limit bestie, don't overflow πspecβ the format that audio data will be stored tobuffer. tell her how you want it served π
β RETURN VALUE β
Returns number of bytes decoded, or -1 on error. and if you get an error? call SDL_GetError() for more information, she'll explain everything π
π₯ THREAD SAFETY π₯
It is safe to call this function from any thread. periodt. go wild, queen π
π AVAILABILITY π
This function is available since SDL_mixer 3.0.0. vintage but make it modern π
that's it bestie, go decode some audio and be iconic πΈπ¦π
β written by the SDL_mixer girlies, SDL_mixer 3.2.4, iykyk πβ¨
π¦ 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