// write the sound buffer as little endian 16bit interleaved stereo
for(i = 0;i < length;i++)
{
- n = buf[i].left >> 2; // quiet enough to prevent clipping most of the time
+ n = buf[i].left;
n = bound(-32768, n, 32767);
out[i*4+0] = n & 0xFF;
out[i*4+1] = (n >> 8) & 0xFF;
- n = buf[i].right >> 2; // quiet enough to prevent clipping most of the time
+ n = buf[i].right;
n = bound(-32768, n, 32767);
out[i*4+2] = n & 0xFF;
out[i*4+3] = (n >> 8) & 0xFF;
// if the channel is paused
if (ch->flags & CHANNELFLAG_PAUSED)
{
- size_t pausedtime;
-
- pausedtime = end - paintedtime;
+ int pausedtime = end - paintedtime;
ch->lastptime += pausedtime;
ch->end += pausedtime;
continue;
// paint up to end
if (ch->end < end)
- count = ch->end - ltime;
+ count = (int)ch->end - ltime;
else
count = end - ltime;