Mix_LoadWAV
Name
Mix_LoadWAV -- Helper macro to load a WAV sample from a filename (Note: The name is misleading. It also supports OGG, MP3, MOD and MIDI)
Synopsis
#include "SDL_mixer.h" Mix_Chunk *Mix_LoadWAV(const char *fname);
Description
Mix_LoadWAV is a macro that creates an SDL_RWops for you then calls Mix_LoadWAV_RW to load a WAV from a file. It supports WAVE-, MOD-, MIDI-, OGG- and MP3 files (sometimes depends on compilation options).
Return Value
Returns a Mix_Chunk containing the whole sample on success, or NULL on error.
Example
Mix_Chunk *chunk=Mix_LoadWAV("myfile.wav");
if(chunk!=NULL) fprintf(stderr,"Loaded myfile.wav\n");
else fprintf(stderr,"Could not load myfile.wav\n");
