table of contents
| MIX_LoadAudio(3) | SDL_mixer3 FUNCTIONS | MIX_LoadAudio(3) |
NAME¶
MIX_LoadAudio - Load audio for playback from a file.
SYNOPSIS¶
#include <SDL3_mixer/SDL_mixer.h>
MIX_Audio * MIX_LoadAudio(MIX_Mixer *mixer, const char *path, bool predecode);
DESCRIPTION¶
This is equivalent to calling:
-
MIX_LoadAudio_IO(mixer, SDL_IOFromFile(path, "rb"), predecode, true);
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()).
FUNCTION PARAMETERS¶
RETURN VALUE¶
Returns an audio object that can be used to make sound on a mixer, or NULL on failure; call SDL_GetError() for more information.
THREAD SAFETY¶
It is safe to call this function from any thread.
AVAILABILITY¶
This function is available since SDL_mixer 3.0.0.
SEE ALSO¶
MIX_DestroyAudio(3), MIX_SetTrackAudio(3), MIX_LoadAudio_IO(3), MIX_LoadAudioWithProperties(3)
| SDL_mixer 3.2.0 | SDL_mixer |