.\" 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_SetPanning: .\" https://wiki.libsdl.org/SDL_mixer/Mix_SetPanning .\" 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_SetPanning .\" 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_SetPanning 3 "SDL_mixer 3.0.0" "SDL_mixer" "SDL_mixer3 FUNCTIONS" .SH NAME Mix_SetPanning \- Set the panning of a channel\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3_mixer/SDL_mixer.h\(dq .PP .BI "int Mix_SetPanning(int channel, Uint8 left, Uint8 right); .fi .SH DESCRIPTION The left and right channels are specified as integers between 0 and 255, quietest to loudest, respectively\[char46] Technically, this is just individual volume control for a sample with two (stereo) channels, so it can be used for more than just panning\[char46] If you want real panning, call it like this: .BR .BR c Mix_SetPanning(channel, left, 255 - left); .BR Setting .BR channel to .BR MIX_CHANNEL_POST registers this as a posteffect, and the panning will be done to the final mixed stream before passing it on to the audio device\[char46] This uses the .BR Mix_RegisterEffect () API internally, and returns without registering the effect function if the audio device is not configured for stereo output\[char46] Setting both .BR left and .BR right to 255 causes this effect to be unregistered, since that is the data's normal state\[char46] Note that an audio device in mono mode is a no-op, but this call will return successful in that case\[char46] Error messages can be retrieved from .BR Mix_GetError ()\[char46] Note that unlike most SDL and SDL_mixer functions, this function returns zero if there's an error, not on success\[char46] We apologize for the API design inconsistency here\[char46] .SH FUNCTION PARAMETERS .TP .I channel The mixer channel to pan or .BR MIX_CHANNEL_POST \[char46] .TP .I left Volume of stereo left channel, 0 is silence, 255 is full volume\[char46] .TP .I right Volume of stereo right channel, 0 is silence, 255 is full volume\[char46] .SH RETURN VALUE Returns zero if error (no such channel or .BR Mix_RegisterEffect () fails), nonzero if panning effect enabled\[char46] .SH AVAILABILITY This function is available since SDL_mixer 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR Mix_SetPosition (3), .BR Mix_SetDistance (3)