cwAudioDeviceAlsa.cpp : Prevent wrapping on 32 bit audio output.
This commit is contained in:
parent
7d4e6fde6c
commit
d59054bc7e
@ -605,7 +605,11 @@ namespace cw
|
|||||||
int* dp = (int*)obuf;
|
int* dp = (int*)obuf;
|
||||||
|
|
||||||
while( sp < ep )
|
while( sp < ep )
|
||||||
*dp++ = (int)(*sp++ * 0x7fffffff);
|
{
|
||||||
|
device::sample_t v = *sp++;
|
||||||
|
v = ((v > 1 ? 1 : v) < -1 ? -1 : v);
|
||||||
|
*dp++ = (int)(v * 0x7fffffff);
|
||||||
|
}
|
||||||
//*dp++ = (rand() - (RAND_MAX/2)) * 2;
|
//*dp++ = (rand() - (RAND_MAX/2)) * 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user