mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
attempt to reduce clipping.. haven't found
the best solution yet.
This commit is contained in:
parent
edbad56202
commit
057e08a8ef
2 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue