Tao.Sdl SDK Documentation

SdlMixer.Mix_LoadWAV Method 

Load WAV from a file.

[Visual Basic]
Public Shared Function Mix_LoadWAV( _
   ByVal file As String _
) As IntPtr
[C#]
public static IntPtr Mix_LoadWAV(
   string file
);

Parameters

file
File name to load sample from.

Return Value

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

Remarks

Load file for use as a sample. This is actually Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1). This can load WAVE, AIFF, RIFF, OGG, and VOC files.

Binds to C-function in SDL_mixer.h

Mix_Chunk *Mix_LoadWAV(char *file)
            

Example

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

See Also

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