Tao.Sdl SDK Documentation

SdlMixer.Mix_LoadWAV_RW Method 

Load a wave file or a music (.mod .s3m .it .xm) file

[Visual Basic]
Public Shared Function Mix_LoadWAV_RW( _
   ByVal src As IntPtr, _
   ByVal freesrc As Integer _
) As IntPtr
[C#]
public static IntPtr Mix_LoadWAV_RW(
   IntPtr src,
   int freesrc
);

Parameters

src
The source SDL_RWops as a pointer. The sample is loaded from this.
freesrc
A non-zero value mean is will automatically close/free the src for you.

Return Value

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

Remarks

Load src for use as a sample. This can load WAVE, AIFF, RIFF, OGG, and VOC formats. Using SDL_RWops is not covered here, but they enable you to load from almost any source.

Binds to C-function in SDL_mixer.h

Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc)
            

Example

            // load sample.wav in to sample
                    Mix_Chunk *sample;
                    sample=Mix_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1);
                    if(!sample)
                {
                    printf("Mix_LoadWAV_RW: %s\n", Mix_GetError());
                    // handle error
                }
            

See Also

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