[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.3 Mix_LoadMUS

Mix_Music *Mix_LoadMUS(const char *file)

Name of music file to use.

Load music file to use. This can load WAVE, MOD, MIDI, OGG, MP3, FLAC, 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.

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

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

See Also:
5.2 Mix_Music, 4.5.14 Mix_SetMusicCMD, 4.5.5 Mix_PlayMusic, 4.5.6 Mix_FadeInMusic, 4.5.7 Mix_FadeInMusicPos

This document was generated on November, 13 2009 using texi2html