table of contents
- experimental 3.1~git20250910~d032535+ds-1
MIX_PostMixCallback(3type) | SDL_mixer3 DATATYPES | MIX_PostMixCallback(3type) |
NAME¶
MIX_PostMixCallback - A callback that fires when all mixing has completed.
HEADER FILE¶
Defined in SDL3_mixer/SDL_mixer.h
SYNOPSIS¶
#include "SDL3_mixer/SDL_mixer.h"
typedef void (SDLCALL *MIX_PostMixCallback)(void *userdata, MIX_Mixer *mixer, const SDL_AudioSpec *spec, float *pcm, int samples);
DESCRIPTION¶
This callback is fired when the mixer has completed all its work. If this mixer was created with MIX_CreateMixerDevice (), the data provided by this callback is what is being sent to the audio hardware, minus last conversions for format requirements. If this mixer was created with MIX_CreateMixer (), this is what is being output from MIX_Generate (), after final conversions.
The audio data passed through here is _not_ const data; the app is permitted to change it in any way it likes, and those changes will replace the final mixer pipeline output.
An audiospec is provided. SDL_mixer always does its mixing work in 32-bit float samples, even if the inputs or final output are not floating point. As such, spec->format will always be SDL_AUDIO_F32 and pcm hardcoded to be a float pointer. samples is the number of float values pointed to by pcm : samples, not sample frames! There are no promises how many samples will be provided per-callback, and this number can vary wildly from call to call, depending on many factors.
FUNCTION PARAMETERS¶
AVAILABILITY¶
This datatype is available since SDL_mixer 3.0.0.
SEE ALSO¶
SDL_mixer 3.1.0 | SDL_mixer |