.\" 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_SetPostMix: .\" https://wiki.libsdl.org/SDL_mixer/Mix_SetPostMix .\" 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_SetPostMix .\" 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_SetPostMix 3 "SDL_mixer 3.0.0" "SDL_mixer" "SDL_mixer3 FUNCTIONS" .SH NAME Mix_SetPostMix \- Set a function that is called after all mixing is performed\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3_mixer/SDL_mixer.h\(dq .PP .BI "void Mix_SetPostMix(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg); .fi .SH DESCRIPTION This can be used to provide real-time visual display of the audio stream or add a custom mixer filter for the stream data\[char46] The callback will fire every time SDL_mixer is ready to supply more data to the audio device, after it has finished all its mixing work\[char46] This runs inside an SDL audio callback, so it's important that the callback return quickly, or there could be problems in the audio playback\[char46] The data provided to the callback is in the format that the audio device was opened in, and it represents the exact waveform SDL_mixer has mixed from all playing chunks and music for playback\[char46] You are allowed to modify the data, but it cannot be resized (so you can't add a reverb effect that goes past the end of the buffer without saving some state between runs to add it into the next callback, or resample the buffer to a smaller size to speed it up, etc)\[char46] The .BR arg pointer supplied here is passed to the callback as-is, for whatever the callback might want to do with it (keep track of some ongoing state, settings, etc)\[char46] Passing a NULL callback disables the post-mix callback until such a time as a new one callback is set\[char46] There is only one callback available\[char46] If you need to mix multiple inputs, be prepared to handle them from a single function\[char46] .SH FUNCTION PARAMETERS .TP .I mix_func the callback function to become the new post-mix callback\[char46] .TP .I arg a pointer that is passed, untouched, to the callback\[char46] .SH AVAILABILITY This function is available since SDL_mixer 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR Mix_HookMusic (3)