[Speex-dev] mixing N sounds together...

Ralph Giles
Fri, 06 Aug 2004 15:02:08 -0000

On Sun, Jun 13, 2004 at 06:42:23PM +0200, Alfr?do Moreira wrote:

> short outputsample[160];
> [...]
>        outputsample[i]  +=  inputsample[i][j];

Also note that if your samples are 16 bit integers, you'll want to
use something larger than 16 for teh accumulation, say a temporary
int sample; Otherwise you can saturate even if you divide by N;

HTH,
-r