.\" This manpage content is licensed under Creative Commons
.\"  Attribution 4.0 International (CC BY 4.0)
.\"   https://creativecommons.org/licenses/by/4.0/
.\" This manpage was generated from SDL_mixer's wiki page for Mix_PlayMusic:
.\"   https://wiki.libsdl.org/SDL_mixer/Mix_PlayMusic
.\" Generated with SDL/build-scripts/wikiheaders.pl
.\"  revision 3~git20250302~78a2035+ds-1
.\" Please report issues in this manpage's content at:
.\"   https://github.com/libsdl-org/sdlwiki/issues/new
.\" Please report issues in the generation of this manpage from the wiki at:
.\"   https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20Mix_PlayMusic
.\" SDL_mixer can be found at https://libsdl.org/projects/SDL_mixer
.de URL
\$2 \(laURL: \$1 \(ra\$3
..
.if \n[.g] .mso www.tmac
.TH Mix_PlayMusic 3 "SDL_mixer 3.0.0" "SDL_mixer" "SDL_mixer3 FUNCTIONS"
.SH NAME
Mix_PlayMusic \- Play a new music object\[char46]
.SH HEADER FILE
Defined in SDL3_mixer/SDL_mixer\[char46]h

.SH SYNOPSIS
.nf
.B #include \(dqSDL3_mixer/SDL_mixer.h\(dq
.PP
.BI "bool Mix_PlayMusic(Mix_Music *music, int loops);
.fi
.SH DESCRIPTION
This will schedule the music object to begin mixing for playback\[char46]

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\[char46]

Please note that if the currently-playing music is in the process of fading
out (via 
.BR Mix_FadeOutMusic
()), this function will
.I block
until the fade completes\[char46] If you need to avoid this, be sure to
call 
.BR Mix_HaltMusic
() before starting new music\[char46]

.SH FUNCTION PARAMETERS
.TP
.I music
the new music object to schedule for mixing\[char46]
.TP
.I loops
the number of loops to play the music for (0 means "play once and stop")\[char46]
.SH RETURN VALUE
Returns true on success or false on failure; call SDL_GetError() for
more information\[char46]

.SH AVAILABILITY
This function is available since SDL_mixer 3\[char46]0\[char46]0\[char46]