From a31f15ee79100d957a2b38f1333b802be1348f1d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 16 Dec 2013 16:57:30 -0800 Subject: [PATCH] don't blow away a channel on local injection loopback --- interface/src/Audio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 95b1a4fbd9..4129973bb7 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -438,7 +438,8 @@ void Audio::addReceivedAudioToBuffer(const QByteArray& audioByteArray) { for (int i = 0; i < NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL; i++) { ringBufferSamples[i * 2] = glm::clamp(ringBufferSamples[i * 2] + _localInjectedSamples[i], MIN_SAMPLE_VALUE, MAX_SAMPLE_VALUE); - ringBufferSamples[(i * 2) + 1] = ringBufferSamples[i * 2]; + ringBufferSamples[(i * 2) + 1] += glm::clamp(ringBufferSamples[(i * 2) + 1] + _localInjectedSamples[i], + MIN_SAMPLE_VALUE, MAX_SAMPLE_VALUE); } // copy the packet from the RB to the output