We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40dd277 commit 071db4aCopy full SHA for 071db4a
AudioOutputCC3200I2S.cpp
@@ -93,10 +93,12 @@ bool AudioOutputCC3200I2S::ConsumeSample(int16_t sample[2])
93
ms[1] = sample[1];
94
MakeSampleStereo16( ms );
95
96
- if (this->mono) {
+ if (this->mono && this->channels == 2) {
97
// Average the two samples and overwrite
98
int32_t ttl = ms[LEFTCHANNEL] + ms[RIGHTCHANNEL];
99
ms[LEFTCHANNEL] = ms[RIGHTCHANNEL] = (ttl>>1) & 0xffff;
100
+ } else if (this->channels == 1) {
101
+ ms[LEFTCHANNEL] = ms[RIGHTCHANNEL];
102
}
103
104
writeBuffer->buffer[writeBuffer->position++] = ms[LEFTCHANNEL];
0 commit comments