table of contents
- experimental 3~git20250302~78a2035+ds-1
Mix_PlayMusic(3) | SDL_mixer3 FUNCTIONS | Mix_PlayMusic(3) |
NAME¶
Mix_PlayMusic - Play a new music object.
HEADER FILE¶
Defined in SDL3_mixer/SDL_mixer.h
SYNOPSIS¶
#include "SDL3_mixer/SDL_mixer.h"
bool Mix_PlayMusic(Mix_Music *music, int loops);
DESCRIPTION¶
This will schedule the music object to begin mixing for playback.
There is only ever one music object playing at a time; if this is called when another music object is playing, the currently-playing music is halted and the new music will replace it.
Please note that if the currently-playing music is in the process of fading out (via Mix_FadeOutMusic ()), this function will block until the fade completes. If you need to avoid this, be sure to call Mix_HaltMusic () before starting new music.
FUNCTION PARAMETERS¶
RETURN VALUE¶
Returns true on success or false on failure; call SDL_GetError() for more information.
AVAILABILITY¶
This function is available since SDL_mixer 3.0.0.
SDL_mixer 3.0.0 | SDL_mixer |