MIX_GetAudioDecoder(3)

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

πŸ’– MIX_GetAudioDecoder(3) πŸ’–

okay bestie, welcome to the SDL_mixer3 manual, and today's main character is MIX_GetAudioDecoder β€” she's the one who tells you the name of a specific audio decoder. no cap.


✨ NAME ✨

MIX_GetAudioDecoder β€” spill the tea on the name of a specific audio decoder. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3_mixer/SDL_mixer.h>

const char * MIX_GetAudioDecoder(int index);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first, what even is an audio decoder? 🎧 it's the thing that turns a specific audio file format into usable PCM data. like, there might be an MP3 decoder, or a WAV decoder, etc. and SDL_mixer probably has several decoders built in. iconic of her honestly. πŸ‘‘

the names are capital English letters and numbers, low-ASCII. and here's the tea: they don't necessarily map to a specific file format. some decoders, like "XMP", operate on multiple file types. and more than one decoder might handle the same file type, like "DRMP3" vs "MPG123". and note that in that last example, neither decoder is called "MP3". so like... don't assume. πŸ™ˆ

the index of a specific decoder is decided during MIX_Init() and does not change until the library is deinitialized. valid indices are between zero and the return value of MIX_GetNumAudioDecoders().

the returned pointer is const memory owned by SDL_mixer β€” do not free it. bestie. i'm serious. don't. 😭

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • index β€” the index of the decoder you wanna query, bestie. πŸ”

⭐ RETURN VALUE ⭐

returns a UTF-8 (really, ASCII) string of the decoder's name, or NULL if index is invalid. so if you get NULL back, that index was not it. πŸ’€


🧚 THREAD SAFETY 🧚

it's safe to call this function from any thread. go off, multi-threaded queen. 🫢


🌈 AVAILABILITY 🌈

this function is available since SDL_mixer 3.0.0. she's been here. she's a veteran. πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ


and that's the whole vibe, bestie β€” this page came to you straight from the SDL_mixer manual, version SDL_mixer 3.2.4. slay, stay curious, and always check your indices. periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from