I want to increase a volume on buffer with voice data. The point is I'm using DirectSound and I have one primary and one secondary buffer - all streams mixing is done by hand. In a voice chat all participants can have independent volume levels. I multiply each stream data by a value (gain) and sum it to one buffer. Everything works fine but when I try to multiply data by a value greater than 1.0f - I hear some clipping or what.
I've tried using Audacity effect compressor but this doesn't help reducing the strange noise.
Probably I should modify gain in some other way? Or just use another post-processing algorithm?
UPDATE: Wow, I've just found out interesting thing! I've dumped audio before increasing volume and right after that.
Here is the pic
Sorry for the quality - I think that's how the sound is supposed to appear (I've drawn red line myself). Really looks like values exceed the sample data type. But I cannot understand WHY? My samplebuffer is BYTE but I access it only via short pointer. It is signed but clipping happens even when *ptr is about 15-20 thousand.