Mix_QuickLoad_RAW -- Load raw audio data of the mixer format from a memory buffer.


#include "SDL_mixer.h"

Mix_Chunk * Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len);


Mix_QuickLoad_RAW loads mem as a raw sample. The data in mem must be already in the output format. If you aren’t sure what you are doing, this is not a good function for you!

Return Value

Returns a pointer to the sample as a Mix_Chunk. NULL is returned on errors, such as out of memory.

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


// quick-load a raw sample from memory
// Uint8 *raw; // I assume you have the raw data here,
               // or compiled in the program...
Mix_Chunk *raw_chunk;
if(!(raw_chunk=Mix_QuickLoad_RAW(raw))) {
    printf("Mix_QuickLoad_RAW: %s\n", Mix_GetError());
    // handle error

See Also

Mix_LoadWAV Mix_QuickLoad_WAV Mix_FreeChunk

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