Load audio for playback from a file.
Defined in <SDL3_mixer/SDL_mixer.h>
const char *path, bool predecode); MIX_Audio * MIX_LoadAudio(MIX_Mixer *mixer,
MIX_Mixer * | mixer | a mixer this audio is intended to be used with. May be NULL. |
const char * | path | the path on the filesystem to load data from. |
bool | predecode | if true, data will be fully uncompressed before returning. |
(MIX_Audio *) Returns an audio object that can be used to make sound on a mixer, or NULL on failure; call SDL_GetError() for more information.
This is equivalent to calling:
"rb"), predecode, true); MIX_LoadAudio_IO(mixer, SDL_IOFromFile(path,
This function loads data from a path on the filesystem. There is also a version that loads from an SDL_IOStream (MIX_LoadAudio_IO()), and one that accepts properties for ultimate control (MIX_LoadAudioWithProperties()).
It is safe to call this function from any thread.
This function is available since SDL_mixer 3.0.0.