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

4.2.5 Mix_QuickLoad_WAV

Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem)

mem
Memory buffer containing a WAVE file in output format.

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.
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.

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

 
// 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:
4.2.3 Mix_LoadWAV, 4.2.6 Mix_QuickLoad_RAW, 4.2.8 Mix_FreeChunk



This document was generated on November, 13 2009 using texi2html