Skip to content

Commit 071db4a

Browse files
committed
single channel to L/R channel
1 parent 40dd277 commit 071db4a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

AudioOutputCC3200I2S.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,12 @@ bool AudioOutputCC3200I2S::ConsumeSample(int16_t sample[2])
9393
ms[1] = sample[1];
9494
MakeSampleStereo16( ms );
9595

96-
if (this->mono) {
96+
if (this->mono && this->channels == 2) {
9797
// Average the two samples and overwrite
9898
int32_t ttl = ms[LEFTCHANNEL] + ms[RIGHTCHANNEL];
9999
ms[LEFTCHANNEL] = ms[RIGHTCHANNEL] = (ttl>>1) & 0xffff;
100+
} else if (this->channels == 1) {
101+
ms[LEFTCHANNEL] = ms[RIGHTCHANNEL];
100102
}
101103

102104
writeBuffer->buffer[writeBuffer->position++] = ms[LEFTCHANNEL];

0 commit comments

Comments
 (0)