Tao.Sdl SDK Documentation

SdlMixer.Mix_QuickLoad_WAV Method 

Load a wave file of the mixer format from a memory buffer

[Visual Basic]
Public Shared Function Mix_QuickLoad_WAV( _
   ByVal mem As IntPtr _
) As IntPtr
[C#]
public static IntPtr Mix_QuickLoad_WAV(
   IntPtr mem
);

Parameters

mem
Memory buffer containing a WAVE file in output format.

Return Value

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

Remarks

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.

Binds to C-function in SDL_mixer.h

Mix_Chunk *Mix_QuickLoad_WAV(Uint8 *mem)
            

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

SdlMixer Class | Tao.Sdl Namespace | Mix_LoadWAV | Mix_QuickLoad_RAW | Mix_FreeChunk