.\" 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_PlayChannel: .\" https://wiki.libsdl.org/SDL_mixer/Mix_PlayChannel .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision 3~git20240319~12fb85e+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_PlayChannel .\" 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_PlayChannel 3 "SDL_mixer 3.0.0" "SDL_mixer" "SDL_mixer3 FUNCTIONS" .SH NAME Mix_PlayChannel \- Play an audio chunk on a specific channel\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3_mixer/SDL_mixer.h\(dq .PP .BI "int Mix_PlayChannel(int channel, Mix_Chunk *chunk, int loops); .fi .SH DESCRIPTION If the specified channel is -1, play on the first free channel (and return -1 without playing anything new if no free channel was available)\[char46] If a specific channel was requested, and there is a chunk already playing there, that chunk will be halted and the new chunk will take its place\[char46] If .BR loops is greater than zero, loop the sound that many times\[char46] If .BR loops is -1, loop "infinitely" (~65000 times)\[char46] Note that before SDL_mixer 3\[char46]0\[char46]0, this function was a macro that called .BR Mix_PlayChannelTimed () with a fourth parameter ("ticks") of -1\[char46] This function still does the same thing, but promotes it to a proper API function\[char46] Older binaries linked against a newer SDL_mixer will still call .BR Mix_PlayChannelTimed directly, as they are using the macro, which was available since the dawn of time\[char46] .SH FUNCTION PARAMETERS .TP .I channel the channel on which to play the new chunk\[char46] .TP .I chunk the new chunk to play\[char46] .TP .I loops the number of times the chunk should loop, -1 to loop (not actually) infinitely\[char46] .SH RETURN VALUE Returns which channel was used to play the sound, or -1 if sound could not be played\[char46] .SH AVAILABILITY This function is available since SDL_mixer 3\[char46]0\[char46]0