MIX_LOADAUDIOWITHPROPERTIES(3)
π MIX_LoadAudioWithProperties π (the NAME bit)
okay bestie, so this page is for MIX_LoadAudioWithProperties, which lives in SDL_mixer3 and hangs out in the FUNCTIONS section π. It's the glow-up version of loading audio β instead of a million args, you hand it a whole collection of properties and it does the thing. Slay.
β¨ SYNOPSIS β¨
#include <SDL3_mixer/SDL_mixer.h>
MIX_Audio * MIX_LoadAudioWithProperties(SDL_PropertiesID props);
literally that's the whole signature, no cap π
πΈ DESCRIPTION πΈ
first things first, go read MIX_LoadAudio_IO() for the rundown on what all the LoadAudio functions actually do β this one's the sibling that speaks in β¨propertiesβ¨. It lets you dictate how it operates and it unlocks functionality the other functions straight-up don't offer. main character energy fr.
SDL_PropertiesID are explained over in SDL's own docs β¨https://wiki.www:lenstrwww:splitstr:nwww:splitstr:r[char46]libsdl.www:lenstrwww:splitstr:nwww:splitstr:r[char46]org/SDL3/CategoryPropertiesβ© π
Here are the properties it supports, and yes we're going through all of them:
MIX_PROP_AUDIO_LOAD_IOSTREAM_POINTERβ a pointer to anSDL_IOStreamthat gets used to load the audio data. Required bestie, you cannot skip this one. And heads up: this stream must be able to seek! π«ΆMIX_PROP_AUDIO_LOAD_CLOSEIO_BOOLEANβ set to true ifSDL_mixershould close theSDL_IOStreambefore returning β and yes, whether it succeeded or failed, the closing still happens.MIX_PROP_AUDIO_LOAD_PREDECODE_BOOLEANβ true ifSDL_mixershould fully decode and decompress the data before returning. If you don't, it stays in its original state and gets decompressed on demand instead. lazy-girl decoding, honestly iconic.MIX_PROP_AUDIO_LOAD_PREFERRED_MIXER_POINTERβ a pointer to aMIX_Mixer, in case steps can be made to match its format while decoding. Optional πMIX_PROP_AUDIO_LOAD_SKIP_METADATA_TAGS_BOOLEANβ true to skip parsing metadata tags, like ID3 and APE tags. This can be used to speed up loading if the data definitely doesn't have these tags. > lowkey a trap though: some decoders will fail if these tags are present when this property is true. read that twice, bestie πMIX_PROP_AUDIO_LOAD_IGNORE_LOOPS_BOOLEANβ true to ignore metadata in the audio data that specifies loop points. This will make a file decode from start to finish without looping, even if the file itself said it should loop. And listen β this audio can still be looped at playback time viaMIX_Trackloop settings, regardless of this setting. Default isfalse.MIX_PROP_AUDIO_DECODER_STRINGβ the name of the decoder to use for this data. Optional. If you don't specify one,SDL_mixerwill examine the data and choose the best decoder for you (king behaviour honestly). These names are the same ones returned fromMIX_GetAudioDecoder().
alsooo, specific decoders might accept additional custom properties, such as where to find soundfonts for MIDI playback, etc. πΉ
π¦ FUNCTION PARAMETERS π¦
propsβ a set of properties on how to load audio. that's it, that's the whole input β¨
π RETURN VALUE π
Returns an audio object that can be used to make sound on a mixer β π₯ β or NULL on failure. If you got NULL, call SDL_GetError() for more info, because the universe owes you an explanation.
π THREAD SAFETY π
It is safe to call this function from any thread. go off, gorl π§
β AVAILABILITY β
This function is available since SDL_mixer 3.0.0. so it's been here, serving looks, for a minute.
π SEE ALSO π
okay that's the whole page, you ate it, periodt ππ
this was brought to you by SDL_mixer 3.2.4 β signed, sealed, delivered by the SDL_mixer girlies themselves πβ¨ slay and goodnight, bestie π«Ά
π¦ 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