Documentation:Hacker's Guide/Audio Mixers
Writing an audio mixer
Writing an audio mixer is very similar to writing an audio filter. The only difference is that you have to deal with the input buffers yourself, and request for new buffers when you need to. Between two calls to pf_do_work, the position in the buffer is remembered in p_input->p_first_byte_to_mix (it isn't always the start of the buffer, since input and output buffers can be of different length). It is your job to set this pointer at the end of pf_do_work.
For more details, please have a look at the float32 mixer. It's much more understandable than lines of documentation.