Mix_SetPostMix behavior

i’ve got a quick question about the behavior of Mix_SetPostMix. i’ve
created some small tests, and it seems the mixer always calls the
callback with the full range of the mixing buffer.

i’m wondering if this is always the case on all platforms? i was
kind of expecting to see the callback returned with smaller portions
of the mix buffer. but in the end, getting the “full” buffer could
make life a little easier.

so am i guaranteed to get the full buffer each time the callback is
called? on all platforms and all sound drivers? i’m guessing that is
just the way things work, SDL_mixer mixes a full buffer together
before sending it off to the soundcard?

i’ve got a quick question about the behavior of Mix_SetPostMix. i’ve
created some small tests, and it seems the mixer always calls the
callback with the full range of the mixing buffer.

Last lines of the SDL_mixer audio callback:

if ( mix_postmix ) {
    mix_postmix(mix_postmix_data, stream, len);
}

Yes, you always get the full buffer as if it was your own SDL audio callback.

–ryan.

Ryan C. Gordon wrote:

Last lines of the SDL_mixer audio callback:

if ( mix_postmix ) {
    mix_postmix(mix_postmix_data, stream, len);
}

Yes, you always get the full buffer as if it was your own SDL audio callback.

nice, thanks. i had peeked at the code, but it looked like "stream"
and “len” were passed into main mixing function. i hadn’t ‘traced
back’ to find who was calling this function and with what data.