fix some indentation and a conditional

This commit is contained in:
Stephen Birarda 2014-12-16 17:06:59 -08:00
parent b7099442c1
commit a99589f6a4
2 changed files with 3 additions and 4 deletions

View file

@ -650,7 +650,7 @@ void Audio::handleAudioInput() {
_inputFormat, _desiredInputFormat);
// only impose the noise gate and perform tone injection if we are sending mono audio
if (!_isStereoInput && _isNoiseGateEnabled) {
if (!_isStereoInput && !_audioSourceInjectEnabled && _isNoiseGateEnabled) {
_inputGate.gateSamples(networkAudioSamples, numNetworkSamples);
// if we performed the noise gate we can get values from it instead of enumerating the samples again
@ -671,12 +671,13 @@ void Audio::handleAudioInput() {
}
}
_lastInputLoudness = fabs(loudness / numNetworkSamples);
_lastInputLoudness = fabs(loudness / numNetworkSamples);
}
} else {
// our input loudness is 0, since we're muted
_lastInputLoudness = 0;
_timeSinceLastClip = 0.0f;
}
emit inputReceived(QByteArray(reinterpret_cast<const char*>(networkAudioSamples),

View file

@ -62,9 +62,7 @@ void AudioNoiseGate::gateSamples(int16_t* samples, int numSamples) {
const int NOISE_GATE_FRAMES_TO_AVERAGE = 5;
const float DC_OFFSET_AVERAGING = 0.99f;
//
// Check clipping, adjust DC offset, and check if should open noise gate
//
float measuredDcOffset = 0.0f;
_didClipInLastFrame = false;