[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.3 Mix_LoadWAV

Mix_Chunk *Mix_LoadWAV(char *file)

file
File name to load sample from.

Load file for use as a sample. This is actually Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1). This can load WAVE, AIFF, RIFF, OGG, and VOC files.
Note: You must call SDL_OpenAudio before this. It must know the output characteristics so it can convert the sample for playback, it does this conversion at load time.

Returns: a pointer to the sample as a Mix_Chunk. NULL is returned on errors.

 
// load sample.wav in to sample
Mix_Chunk *sample;
sample=Mix_LoadWAV("sample.wav");
if(!sample) {
    printf("Mix_LoadWAV: %s\n", Mix_GetError());
    // handle error
}

See Also:
4.2.4 Mix_LoadWAV_RW, 4.2.5 Mix_QuickLoad_WAV, 4.2.8 Mix_FreeChunk



This document was generated on November, 13 2009 using texi2html