Tao.Sdl SDK Documentation

SdlMixer.Mix_LoadMUS Method 

Load a music file into a Mix_Music

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

Parameters

file
Name of music file to use.

Return Value

A pointer to a Mix_Music. NULL is returned on errors.

Remarks

Load music file to use. This can load WAVE, MOD, MIDI, OGG, MP3, and any file that you use a command to play with.

If you are using an external command to play the music, you must call Mix_SetMusicCMD before this, otherwise the internal players will be used. Alternatively, if you have set an external command up and don't want to use it, you must call Mix_SetMusicCMD(NULL) to use the built-in players again.

Binds to C-function in SDL_mixer.h

Mix_Music *Mix_LoadMUS(const char *file)
            

Example

            // load the MP3 file "music.mp3" to play as music
                    Mix_Music *music;
                    music=Mix_LoadMUS("music.mp3");
                    if(!music)
                {
                    printf("Mix_LoadMUS(\"music.mp3\"): %s\n", Mix_GetError());
                    // this might be a critical error...
                }
            

See Also

SdlMixer Class | Tao.Sdl Namespace | Mix_SetMusicCMD | Mix_PlayMusic | Mix_FadeInMusic | Mix_FadeInMusicPos