Mix_QuickLoad_WAV

Name

Mix_QuickLoad_WAV -- Load a wave file of the mixer format from a memory buffer.

Synopsis

#include "SDL_mixer.h"

Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem);

Description

Mix_QuickLoad_WAV Load mem as a WAVE/RIFF file into a new sample. The WAVE in mem must be already in the output format. It would be better to use Mix_LoadWAV_RW if you aren’t sure.

Return Value

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

Note: This function does very little checking. If the format mismatches the output format, or if the buffer is not a WAVE, it will not return an error. This is probably a dangerous function to use.

Example

// quick-load a wave from memory
// Uint8 *wave; // I assume you have the wave loaded raw,
                // or compiled in the program...
Mix_Chunk *wave_chunk;
if(!(wave_chunk=Mix_QuickLoad_WAV(wave))) {
    printf("Mix_QuickLoad_WAV: %s\n", Mix_GetError());
    // handle error
}

See Also

Mix_LoadWAV Mix_QuickLoad_RAW Mix_FreeChunk

Mix_QuickLoad_WAV (last edited 2008-04-17 08:18:10 by localhost)