Mix_QuickLoad_RAW
Name
Mix_QuickLoad_RAW -- Load raw audio data of the mixer format from a memory buffer.
Synopsis
#include "SDL_mixer.h" Mix_Chunk * Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len);
Description
Mix_QuickLoad_RAW loads mem as a raw sample. The data in mem must be already in the output format. If you arent 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.
Example
// 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
}
