Mixing is easy.
Work across buffers; a+b+c/numchannels
ie: If you have 7 channels mixing now, add 'em up and divide by 7. (Theres other averaging methods, but thats a basic workable one.)
Thats it; thats all a basic mixer does.
Ie: Its more complex if youhave to mix 8bit and 165bit samples together, and if some are signed and others usngiend, since you ave to convert; but if aqll your samples are the same shape/size then its just that easy; if they're different, then you can convert them all to 16bit at load time, or at mix time; ie; 8bit to 16bit is just shift-8 to get them into thre same size..
So really not too hard.
I keep a struct of sample playback and progress, and a list of samples; so adding to my mixer just creates a struct which points to which sample it represents, and how far along it is, and options (fade, etc.)
Then the mixer runs throgh the list of all currently playing samples, mixing their current step, and incrementing the step count. (At load time I convert all samples to the same bits-per-second, 16bit, so that I needn't woryr about stretching 11khz to 22khz live, etc.)
So mine has no limit channels.. it cna mix 100 samples if it wants, though in practice I cap it off around 4 or 5, and most of my little games just don't have that much going on.
Then I mix with background audio afterwards.
Not so hard
jeff