mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
Remove old noise gate
This commit is contained in:
parent
175d1be7ca
commit
8608695695
2 changed files with 4 additions and 5 deletions
|
@ -1041,12 +1041,13 @@ void AudioClient::handleAudioInput(QByteArray& audioBuffer) {
|
|||
}
|
||||
|
||||
// TODO: optimize this
|
||||
const float CLIPPING_THRESHOLD = 0.90f;
|
||||
float loudness = 0.0f;
|
||||
bool didClip = false;
|
||||
for (int i = 0; i < numSamples; ++i) {
|
||||
int16_t sample = std::abs(samples[i]);
|
||||
loudness += (float)sample;
|
||||
didClip = didClip || (sample > (AudioConstants::MAX_SAMPLE_VALUE * AudioNoiseGate::CLIPPING_THRESHOLD));
|
||||
didClip = didClip || (sample > (AudioConstants::MAX_SAMPLE_VALUE * CLIPPING_THRESHOLD));
|
||||
}
|
||||
_lastInputLoudness = fabs(loudness / numSamples);
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include <AudioReverb.h>
|
||||
#include <AudioLimiter.h>
|
||||
#include <AudioConstants.h>
|
||||
#include <AudioNoiseGate.h>
|
||||
#include <AudioGate.h>
|
||||
|
||||
#include <shared/RateCounter.h>
|
||||
|
@ -110,7 +109,7 @@ public:
|
|||
void selectAudioFormat(const QString& selectedCodecName);
|
||||
|
||||
Q_INVOKABLE QString getSelectedAudioFormat() const { return _selectedCodecName; }
|
||||
Q_INVOKABLE bool getNoiseGateOpen() const { return _noiseGate.isOpen(); }
|
||||
Q_INVOKABLE bool getNoiseGateOpen() const { return _audioGateOpen; }
|
||||
Q_INVOKABLE float getSilentInboundPPS() const { return _silentInbound.rate(); }
|
||||
Q_INVOKABLE float getAudioInboundPPS() const { return _audioInbound.rate(); }
|
||||
Q_INVOKABLE float getSilentOutboundPPS() const { return _silentOutbound.rate(); }
|
||||
|
@ -119,7 +118,7 @@ public:
|
|||
const MixedProcessedAudioStream& getReceivedAudioStream() const { return _receivedAudioStream; }
|
||||
MixedProcessedAudioStream& getReceivedAudioStream() { return _receivedAudioStream; }
|
||||
|
||||
float getLastInputLoudness() const { return glm::max(_lastInputLoudness - _noiseGate.getMeasuredFloor(), 0.0f); }
|
||||
float getLastInputLoudness() const { return _lastInputLoudness; } // TODO: relative to noise floor?
|
||||
|
||||
float getTimeSinceLastClip() const { return _timeSinceLastClip; }
|
||||
float getAudioAverageInputLoudness() const { return _lastInputLoudness; }
|
||||
|
@ -361,7 +360,6 @@ private:
|
|||
|
||||
AudioIOStats _stats;
|
||||
|
||||
AudioNoiseGate _noiseGate;
|
||||
AudioGate* _audioGate { nullptr };
|
||||
bool _audioGateOpen { false };
|
||||
|
||||
|
|
Loading…
Reference in a new issue