table of contents
- experimental 3~git20250302~78a2035+ds-1
Mix_QuickLoad_WAV(3) | SDL_mixer3 FUNCTIONS | Mix_QuickLoad_WAV(3) |
NAME¶
Mix_QuickLoad_WAV - Load a WAV file from memory as quickly as possible.
HEADER FILE¶
Defined in SDL3_mixer/SDL_mixer.h
SYNOPSIS¶
#include "SDL3_mixer/SDL_mixer.h"
Mix_Chunk * Mix_QuickLoad_WAV(Uint8 *mem);
DESCRIPTION¶
Unlike Mix_LoadWAV_IO , this function has several requirements, and unless you control all your audio data and know what you're doing, you should consider this function unsafe and not use it.
• The provided audio data MUST be in Microsoft WAV format.
• The provided audio data shouldn't use any strange WAV extensions.
• The audio data MUST be in the exact same format as the
audio device. This
function will not attempt to convert it, or even verify it's in the right
format.
• The audio data must be valid; this function does not know
the size of the
memory buffer, so if the WAV data is corrupted, it can read past the end
of the buffer, causing a crash.
• The audio data must live at least as long as the returned
Mix_Chunk , because SDL_mixer will use that data directly
and
not make a copy of it.
This function will do NO error checking! Be extremely careful here!
(Seriously, use Mix_LoadWAV_IO
instead.)
If this function is successful, the provided memory buffer must remain available until Mix_FreeChunk () is called on the returned chunk.
FUNCTION PARAMETERS¶
- mem
- memory buffer containing of a WAV file.
RETURN VALUE¶
( Mix_Chunk
*) Returns a new chunk, or NULL on error.
AVAILABILITY¶
This function is available since SDL_mixer 3.0.0.
SEE ALSO¶
•(3), Mix_LoadWAV_IO(3), •(3), Mix_FreeChunk(3)
SDL_mixer 3.0.0 | SDL_mixer |