attempt to reduce clipping.. haven't found

the best solution yet.
This commit is contained in:
Eric Wasylishen 2011-01-17 16:19:03 -07:00
parent edbad56202
commit 057e08a8ef
2 changed files with 6 additions and 1 deletions

View file

@ -306,6 +306,11 @@ void SND_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int count)
right = (data * rightvol) >> 8;
paintbuffer[i].left += left;
paintbuffer[i].right += right;
if (paintbuffer[i].left > (1 << 24))
{
Con_Printf("Clipping!\n");
}
}
ch->pos += count;

View file

@ -21,7 +21,7 @@ void *Snd_Resample(int inrate, int inwidth, int innumsamples, int channels, cons
int i;
for (i=0; i<innumsamples; i++)
{
in16bit[i] = (((unsigned char *)indata)[i] - 128) << 8;
in16bit[i] = (((unsigned char *)indata)[i] - 128) << 6; // FIXME: should be << 8, but causes clipping
}
}
else