QUOTE(DualIP @ Apr 16 2008, 00:48)

QUOTE(Jebus @ Apr 16 2008, 03:09)

I assume I just add the two channels together and then divide by 2
When using 16 bits integer numbers, first divide by 2 then add them together! This rules out overflow which causes very nasty distortion.
I'm no expert here (not even an amateur), but if you do that, you guarantee the LSB is always zero. That seems like a potential problem area to me.
If forced into 16-bit math when adding two channels, what you probably want to do is add the two together with a 16-bit addition routine that can also alert you of overflow via a carry flag (vs. an error or no notification). Then divide by two (shift right) and apply the carry flag to the MSB if set.
But I'm guessing (again, not an expert here) that even that probably raises some potential noise signature issues in the LSB area - there's probably some sort of dither and/or noise-shaping that should be considered after this step. Or maybe not.
EDIT: of course, above I'm talking of non-negative numbers only. IIRC, audio data is often stored in signed integer format, so the math above needs another level of complexity to ensure the signs are preserved accurately.
-brendan