PCM DAC: fix muting

This commit is contained in:
tildearrow 2023-03-17 14:32:39 -05:00
parent 6985b85c09
commit 5fc36b1d4c
1 changed files with 6 additions and 2 deletions

View File

@ -30,7 +30,7 @@ void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
const int depthScale=(15-outDepth);
int output=0;
for (size_t h=0; h<len; h++) {
if (!chan[0].active || isMuted) {
if (!chan[0].active) {
buf[0][h]=0;
buf[1][h]=0;
oscBuf->data[oscBuf->needle++]=0;
@ -171,7 +171,11 @@ void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
}
}
}
output=output*chan[0].vol*chan[0].envVol/16384;
if (isMuted) {
output=0;
} else {
output=output*chan[0].vol*chan[0].envVol/16384;
}
oscBuf->data[oscBuf->needle++]=output;
if (outStereo) {
buf[0][h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale;