From d2875c2c4fa0e430e81f4d017e515a1786daee67 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Tue, 9 Feb 2021 00:44:01 -0500 Subject: [PATCH 01/13] Add manual mode to noise reduction + add noise reduction threshold --- interface/src/scripting/Audio.cpp | 50 ++++++++++++++++++++++ interface/src/scripting/Audio.h | 26 +++++++++++ libraries/audio-client/src/AudioClient.cpp | 32 +++++++++++++- libraries/audio-client/src/AudioClient.h | 12 ++++++ 4 files changed, 119 insertions(+), 1 deletion(-) diff --git a/interface/src/scripting/Audio.cpp b/interface/src/scripting/Audio.cpp index 43958188e3..36045bd8ec 100644 --- a/interface/src/scripting/Audio.cpp +++ b/interface/src/scripting/Audio.cpp @@ -25,6 +25,8 @@ QString Audio::DESKTOP { "Desktop" }; QString Audio::HMD { "VR" }; Setting::Handle enableNoiseReductionSetting { QStringList { Audio::AUDIO, "NoiseReduction" }, true }; +Setting::Handle enableNoiseReductionAutomaticSetting { QStringList { Audio::AUDIO, "NoiseReductionAutomatic" }, false }; +Setting::Handle setNoiseReductionThresholdSetting { QStringList { Audio::AUDIO, "NoiseReductionThreshold" }, 0.2f }; Setting::Handle enableWarnWhenMutedSetting { QStringList { Audio::AUDIO, "WarnWhenMuted" }, true }; Setting::Handle enableAcousticEchoCancellationSetting { QStringList { Audio::AUDIO, "AcousticEchoCancellation" }, true }; @@ -40,6 +42,8 @@ Audio::Audio() : _devices(_contextIsHMD) { auto client = DependencyManager::get().data(); connect(client, &AudioClient::muteToggled, this, &Audio::setMuted); connect(client, &AudioClient::noiseReductionChanged, this, &Audio::enableNoiseReduction); + connect(client, &AudioClient::noiseReductionAutomaticChanged, this, &Audio::enableNoiseReductionAutomatic); + connect(client, &AudioClient::noiseReductionThresholdChanged, this, &Audio::setNoiseReductionThreshold); connect(client, &AudioClient::warnWhenMutedChanged, this, &Audio::enableWarnWhenMuted); connect(client, &AudioClient::acousticEchoCancellationChanged, this, &Audio::enableAcousticEchoCancellation); connect(client, &AudioClient::inputLoudnessChanged, this, &Audio::onInputLoudnessChanged); @@ -47,6 +51,8 @@ Audio::Audio() : _devices(_contextIsHMD) { connect(this, &Audio::contextChanged, &_devices, &AudioDevices::onContextChanged); connect(this, &Audio::pushingToTalkChanged, this, &Audio::handlePushedToTalk); enableNoiseReduction(enableNoiseReductionSetting.get()); + enableNoiseReductionAutomatic(enableNoiseReductionAutomaticSetting.get()); + setNoiseReductionThreshold(setNoiseReductionThresholdSetting.get()); enableWarnWhenMuted(enableWarnWhenMutedSetting.get()); enableAcousticEchoCancellation(enableAcousticEchoCancellationSetting.get()); onContextChanged(); @@ -286,6 +292,50 @@ void Audio::enableNoiseReduction(bool enable) { } } +bool Audio::noiseReductionAutomatic() const { + return resultWithReadLock([&] { + return _noiseReductionAutomatic; + }); +} + +void Audio::enableNoiseReductionAutomatic(bool enable) { + bool changed = false; + withWriteLock([&] { + if (_noiseReductionAutomatic != enable) { + _noiseReductionAutomatic = enable; + auto client = DependencyManager::get().data(); + QMetaObject::invokeMethod(client, "setNoiseReductionAutomatic", Q_ARG(bool, enable), Q_ARG(bool, false)); + enableNoiseReductionAutomaticSetting.set(enable); + changed = true; + } + }); + if (changed) { + emit noiseReductionAutomaticChanged(enable); + } +} + +float Audio::getNoiseReductionThreshold() const { + return resultWithReadLock([&] { + return _noiseReductionThreshold; + }); +} + +void Audio::setNoiseReductionThreshold(float threshold) { + bool changed = false; + withWriteLock([&] { + if (_noiseReductionThreshold != threshold) { + _noiseReductionThreshold = threshold; + auto client = DependencyManager::get().data(); + QMetaObject::invokeMethod(client, "setNoiseReductionThreshold", Q_ARG(float, threshold), Q_ARG(bool, false)); + setNoiseReductionThresholdSetting.set(threshold); + changed = true; + } + }); + if (changed) { + emit noiseReductionAutomaticChanged(threshold); + } +} + bool Audio::warnWhenMutedEnabled() const { return resultWithReadLock([&] { return _enableWarnWhenMuted; diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index 74d85f0107..3addd6d5a4 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -92,6 +92,8 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) Q_PROPERTY(bool noiseReduction READ noiseReductionEnabled WRITE enableNoiseReduction NOTIFY noiseReductionChanged) + Q_PROPERTY(bool noiseReductionAutomatic READ noiseReductionAutomatic WRITE enableNoiseReductionAutomatic NOTIFY noiseReductionAutomaticChanged) + Q_PROPERTY(float noiseReductionThreshold READ getNoiseReductionThreshold WRITE setNoiseReductionThreshold NOTIFY noiseReductionThresholdChanged) Q_PROPERTY(bool warnWhenMuted READ warnWhenMutedEnabled WRITE enableWarnWhenMuted NOTIFY warnWhenMutedChanged) Q_PROPERTY(bool acousticEchoCancellation READ acousticEchoCancellationEnabled WRITE enableAcousticEchoCancellation NOTIFY acousticEchoCancellationChanged) @@ -124,6 +126,8 @@ public: bool isMuted() const; bool noiseReductionEnabled() const; + bool noiseReductionAutomatic() const; + float getNoiseReductionThreshold() const; bool warnWhenMutedEnabled() const; bool acousticEchoCancellationEnabled() const; float getInputVolume() const; @@ -398,6 +402,24 @@ signals: * @returns {Signal} */ void noiseReductionChanged(bool isEnabled); + + /**jsdoc + * Triggered when the audio input noise reduction mode is changed. + * @function Audio.noiseReductionAutomaticChanged + * @param {boolean} isEnabled - true if audio input noise reduction automatic mode is enabled, otherwise false. + * This means the mode is set to 'manual'. + * @returns {Signal} + */ + void noiseReductionAutomaticChanged(bool isEnabled); + + /**jsdoc + * Triggered when audio input noise reduction threshold is changed. + * @function Audio.noiseReductionThresholdChanged + * @param {number} threshold - The threshold for the audio input noise reduction, range 0.0 (open the gate completely) – 1.0 + * (close the gate completely). + * @returns {Signal} + */ + void noiseReductionThresholdChanged(float threshold); /**jsdoc * Triggered when "warn when muted" is enabled or disabled. @@ -512,6 +534,8 @@ public slots: private slots: void setMuted(bool muted); void enableNoiseReduction(bool enable); + void enableNoiseReductionAutomatic(bool enable); + void setNoiseReductionThreshold(float threshold); void enableWarnWhenMuted(bool enable); void enableAcousticEchoCancellation(bool enable); void setInputVolume(float volume); @@ -533,8 +557,10 @@ private: float _localInjectorGain { 0.0f }; // in dB float _systemInjectorGain { 0.0f }; // in dB float _pttOutputGainDesktop { 0.0f }; // in dB + float _noiseReductionThreshold { 0.2f }; // Match default value of AudioClient::_noiseReductionThreshold. bool _isClipping { false }; bool _enableNoiseReduction { true }; // Match default value of AudioClient::_isNoiseGateEnabled. + bool _noiseReductionAutomatic { true }; // Match default value of AudioClient::_noiseReductionAutomatic. bool _enableWarnWhenMuted { true }; bool _enableAcousticEchoCancellation { true }; // AudioClient::_isAECEnabled bool _contextIsHMD { false }; diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 2600097c3b..a3d2568b6d 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -1342,6 +1342,13 @@ void AudioClient::handleLocalEchoAndReverb(QByteArray& inputByteArray) { } } +float AudioClient::loudnessToLevel(float loudness) { + float level = loudness * (1 / 32768.0f); // level in [0, 1] + level = 6.02059991f * fastLog2f(level); // convert to dBFS + level = (level + 48.0f) * (1 / 42.0f); // map [-48, -6] dBFS to [0, 1] + return glm::clamp(level, 0.0f, 1.0f); +} + void AudioClient::handleAudioInput(QByteArray& audioBuffer) { if (!_audioPaused) { @@ -1352,9 +1359,14 @@ void AudioClient::handleAudioInput(QByteArray& audioBuffer) { int numSamples = audioBuffer.size() / AudioConstants::SAMPLE_SIZE; int numFrames = numSamples / (_isStereoInput ? AudioConstants::STEREO : AudioConstants::MONO); - if (_isNoiseGateEnabled) { + if (_isNoiseGateEnabled && _isNoiseReductionAutomatic) { // The audio gate includes DC removal audioGateOpen = _audioGate->render(samples, samples, numFrames); + } else if (_isNoiseGateEnabled && !_isNoiseReductionAutomatic && + loudnessToLevel(_lastSmoothedRawInputLoudness) >= _noiseReductionThreshold) { + audioGateOpen = _audioGate->removeDC(samples, samples, numFrames); + } else if (_isNoiseGateEnabled && !_isNoiseReductionAutomatic) { + audioGateOpen = false; } else { audioGateOpen = _audioGate->removeDC(samples, samples, numFrames); } @@ -1750,6 +1762,24 @@ void AudioClient::setNoiseReduction(bool enable, bool emitSignal) { } } +void AudioClient::setNoiseReductionAutomatic(bool enable, bool emitSignal) { + if (_isNoiseReductionAutomatic != enable) { + _isNoiseReductionAutomatic = enable; + if (emitSignal) { + emit noiseReductionAutomaticChanged(_isNoiseReductionAutomatic); + } + } +} + +void AudioClient::setNoiseReductionThreshold(float threshold, bool emitSignal) { + if (_noiseReductionThreshold != threshold) { + _noiseReductionThreshold = threshold; + if (emitSignal) { + emit noiseReductionThresholdChanged(_noiseReductionThreshold); + } + } +} + void AudioClient::setWarnWhenMuted(bool enable, bool emitSignal) { if (_warnWhenMuted != enable) { _warnWhenMuted = enable; diff --git a/libraries/audio-client/src/AudioClient.h b/libraries/audio-client/src/AudioClient.h index 09abb2c356..f101d68a0e 100644 --- a/libraries/audio-client/src/AudioClient.h +++ b/libraries/audio-client/src/AudioClient.h @@ -217,6 +217,12 @@ public slots: void setNoiseReduction(bool isNoiseGateEnabled, bool emitSignal = true); bool isNoiseReductionEnabled() const { return _isNoiseGateEnabled; } + + void setNoiseReductionAutomatic(bool isNoiseGateAutomatic, bool emitSignal = true); + bool isNoiseReductionAutomatic() const { return _isNoiseReductionAutomatic; } + + void setNoiseReductionThreshold(float noiseReductionThreshold, bool emitSignal = true); + float noiseReductionThreshold() const { return _noiseReductionThreshold; } void setWarnWhenMuted(bool isNoiseGateEnabled, bool emitSignal = true); bool isWarnWhenMutedEnabled() const { return _warnWhenMuted; } @@ -265,6 +271,8 @@ signals: void inputVolumeChanged(float volume); void muteToggled(bool muted); void noiseReductionChanged(bool noiseReductionEnabled); + void noiseReductionAutomaticChanged(bool noiseReductionAutomatic); + void noiseReductionThresholdChanged(bool noiseReductionThreshold); void warnWhenMutedChanged(bool warnWhenMutedEnabled); void acousticEchoCancellationChanged(bool acousticEchoCancellationEnabled); void mutedByMixer(); @@ -310,6 +318,8 @@ private: friend class CheckDevicesThread; friend class LocalInjectorsThread; + float loudnessToLevel(float loudness); + // background tasks void checkDevices(); void checkPeakValues(); @@ -397,6 +407,8 @@ private: bool _shouldEchoLocally{ false }; bool _shouldEchoToServer{ false }; bool _isNoiseGateEnabled{ true }; + bool _isNoiseReductionAutomatic{ true }; + float _noiseReductionThreshold{ 0.2f }; bool _warnWhenMuted; bool _isAECEnabled{ true }; From 5a40007758f409e719134c19630565505fbe8ab1 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Tue, 9 Feb 2021 00:46:46 -0500 Subject: [PATCH 02/13] Update default threshold value. --- interface/src/scripting/Audio.h | 2 +- libraries/audio-client/src/AudioClient.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index 3addd6d5a4..cd1a2002ed 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -557,7 +557,7 @@ private: float _localInjectorGain { 0.0f }; // in dB float _systemInjectorGain { 0.0f }; // in dB float _pttOutputGainDesktop { 0.0f }; // in dB - float _noiseReductionThreshold { 0.2f }; // Match default value of AudioClient::_noiseReductionThreshold. + float _noiseReductionThreshold { 0.1f }; // Match default value of AudioClient::_noiseReductionThreshold. bool _isClipping { false }; bool _enableNoiseReduction { true }; // Match default value of AudioClient::_isNoiseGateEnabled. bool _noiseReductionAutomatic { true }; // Match default value of AudioClient::_noiseReductionAutomatic. diff --git a/libraries/audio-client/src/AudioClient.h b/libraries/audio-client/src/AudioClient.h index f101d68a0e..a5de9bd4ca 100644 --- a/libraries/audio-client/src/AudioClient.h +++ b/libraries/audio-client/src/AudioClient.h @@ -408,7 +408,7 @@ private: bool _shouldEchoToServer{ false }; bool _isNoiseGateEnabled{ true }; bool _isNoiseReductionAutomatic{ true }; - float _noiseReductionThreshold{ 0.2f }; + float _noiseReductionThreshold{ 0.1f }; bool _warnWhenMuted; bool _isAECEnabled{ true }; From 085bf8423c4ec2bafc8cdbd621a4b37b5537f1cd Mon Sep 17 00:00:00 2001 From: Kalila L Date: Thu, 11 Feb 2021 05:55:08 -0500 Subject: [PATCH 03/13] Update APIs and add Noise Reduction section to Audio app. --- interface/resources/qml/hifi/audio/Audio.qml | 220 +++++++++++++++---- interface/src/scripting/Audio.cpp | 2 +- interface/src/scripting/Audio.h | 16 +- 3 files changed, 195 insertions(+), 43 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 31f3ee44df..9f08f1bd3b 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -104,6 +104,11 @@ Rectangle { AudioScriptingInterface.setSystemInjectorGain(sliderValue); } } + function updateNoiseReductionThresholdFromQML(sliderValue) { + if (AudioScriptingInterface.getNoiseReductionThreshold() != sliderValue) { + AudioScriptingInterface.setNoiseReductionThreshold(sliderValue); + } + } Component.onCompleted: { enablePeakValues(); @@ -164,7 +169,7 @@ Rectangle { x: 2 * margins.paddings; width: parent.width; // switch heights + 2 * top margins - height: (root.switchHeight) * 6 + 48; + height: (bar.currentIndex === 0) ? (root.switchHeight) * 2 + 48 : (root.switchHeight) * 4 + 48; anchors.top: firstSeparator.bottom; anchors.topMargin: 10; @@ -175,6 +180,7 @@ Rectangle { height: parent.height; anchors.top: parent.top anchors.left: parent.left; + HifiControlsUit.Switch { id: muteMic; height: root.switchHeight; @@ -193,45 +199,11 @@ Rectangle { } } - HifiControlsUit.Switch { - id: noiseReductionSwitch; - height: root.switchHeight; - switchWidth: root.switchWidth; - anchors.top: muteMic.bottom; - anchors.topMargin: 24 - anchors.left: parent.left - labelTextOn: "Noise Reduction"; - labelTextSize: 16; - backgroundOnColor: "#E3E3E3"; - checked: AudioScriptingInterface.noiseReduction; - onCheckedChanged: { - AudioScriptingInterface.noiseReduction = checked; - checked = Qt.binding(function() { return AudioScriptingInterface.noiseReduction; }); // restore binding - } - } - - HifiControlsUit.Switch { - id: acousticEchoCancellationSwitch; - height: root.switchHeight; - switchWidth: root.switchWidth; - anchors.top: noiseReductionSwitch.bottom - anchors.topMargin: 24 - anchors.left: parent.left - labelTextOn: "Echo Cancellation"; - labelTextSize: 16; - backgroundOnColor: "#E3E3E3"; - checked: AudioScriptingInterface.acousticEchoCancellation; - onCheckedChanged: { - AudioScriptingInterface.acousticEchoCancellation = checked; - checked = Qt.binding(function() { return AudioScriptingInterface.acousticEchoCancellation; }); - } - } - HifiControlsUit.Switch { id: pttSwitch height: root.switchHeight; switchWidth: root.switchWidth; - anchors.top: acousticEchoCancellationSwitch.bottom; + anchors.top: muteMic.bottom; anchors.topMargin: 24 anchors.left: parent.left labelTextOn: (bar.currentIndex === 0) ? qsTr("Push To Talk (T)") : qsTr("Push To Talk"); @@ -254,6 +226,7 @@ Rectangle { height: parent.height; anchors.top: parent.top anchors.left: switchContainer.right; + HifiControlsUit.Switch { id: warnMutedSwitch height: root.switchHeight; @@ -271,7 +244,6 @@ Rectangle { } } - HifiControlsUit.Switch { id: audioLevelSwitch height: root.switchHeight; @@ -519,13 +491,181 @@ Rectangle { anchors.top: systemInjectorGainContainer.bottom; anchors.topMargin: 10; } + + Item { + id: noiseReductionHeader + x: margins.paddings; + width: parent.width - margins.paddings*2; + height: 36; + anchors.top: secondSeparator.bottom; + anchors.topMargin: 10; + + HiFiGlyphs { + width: margins.sizeCheckBox; + text: hifi.glyphs.mic; + color: hifi.colors.white; + anchors.left: parent.left; + anchors.leftMargin: -size/4; //the glyph has empty space at left about 25% + anchors.verticalCenter: parent.verticalCenter; + size: 30; + } + + RalewayRegular { + anchors.verticalCenter: parent.verticalCenter; + width: margins.sizeText + margins.sizeLevel; + anchors.left: parent.left; + anchors.leftMargin: margins.sizeCheckBox; + size: 22; + color: hifi.colors.white; + text: qsTr("Noise Reduction"); + } + } + + Item { + id: noiseReductionSwitches; + x: 2 * margins.paddings; + width: parent.width; + // switch heights + 2 * top margins + height: (root.switchHeight) * 5 + 48; + anchors.top: noiseReductionHeader.bottom; + anchors.topMargin: 0; + + Item { + id: noiseReductionSwitchContainer; + x: margins.paddings; + width: parent.width / 2; + height: parent.height; + anchors.top: parent.top; + anchors.left: parent.left; + + HifiControlsUit.Switch { + id: acousticEchoCancellationSwitch; + height: root.switchHeight; + switchWidth: root.switchWidth; + anchors.top: noiseReductionSwitchContainer.top + anchors.topMargin: 24 + anchors.left: parent.left + labelTextOn: "Echo Cancellation"; + labelTextSize: 16; + backgroundOnColor: "#E3E3E3"; + checked: AudioScriptingInterface.acousticEchoCancellation; + onCheckedChanged: { + AudioScriptingInterface.acousticEchoCancellation = checked; + checked = Qt.binding(function() { return AudioScriptingInterface.acousticEchoCancellation; }); + } + } + + HifiControlsUit.Switch { + id: noiseReductionSwitch; + height: root.switchHeight; + switchWidth: root.switchWidth; + anchors.top: acousticEchoCancellationSwitch.bottom; + anchors.topMargin: 24 + anchors.left: parent.left + labelTextOn: "Noise Reduction"; + labelTextSize: 16; + backgroundOnColor: "#E3E3E3"; + checked: AudioScriptingInterface.noiseReduction; + onCheckedChanged: { + AudioScriptingInterface.noiseReduction = checked; + checked = Qt.binding(function() { return AudioScriptingInterface.noiseReduction; }); // restore binding + } + } + + HifiControlsUit.Switch { + id: noiseReductionAutomaticSwitch; + height: root.switchHeight; + switchWidth: root.switchWidth; + anchors.top: noiseReductionSwitch.bottom; + anchors.topMargin: 24; + anchors.left: parent.left; + labelTextOn: "Noise Reduction: Manual/Automatic"; + labelTextSize: 16; + backgroundOnColor: "#E3E3E3"; + checked: AudioScriptingInterface.noiseReductionAutomatic; + onCheckedChanged: { + AudioScriptingInterface.noiseReductionAutomatic = checked; + checked = Qt.binding(function() { return AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding + } + } + } + } + + Item { + id: noiseReductionThresholdContainer + x: margins.paddings; + anchors.top: noiseReductionSwitches.bottom; + anchors.topMargin: 16; + width: parent.width - margins.paddings*2; + height: avatarGainSliderTextMetrics.height; + visible: AudioScriptingInterface.noiseReductionAutomatic !== true; + + HifiControlsUit.Slider { + id: noiseReductionThresholdSlider + anchors.right: parent.right + height: parent.height + width: 200 + minimumValue: 0.0 + maximumValue: 1.0 + stepSize: 0.1 + value: AudioScriptingInterface.getNoiseReductionThreshold() + onValueChanged: { + updateNoiseReductionThresholdFromQML(value); + } + onPressedChanged: { + if (!pressed) { + updateNoiseReductionThresholdFromQML(value); + } + } + + MouseArea { + anchors.fill: parent + onWheel: { + // Do nothing. + } + onDoubleClicked: { + noiseReductionThresholdSlider.value = 0.0 + } + onPressed: { + // Pass through to Slider + mouse.accepted = false + } + onReleased: { + // the above mouse.accepted seems to make this + // never get called, nonetheless... + mouse.accepted = false + } + } + } + TextMetrics { + id: noiseReductionThresholdSliderTextMetrics + text: noiseReductionThresholdSliderText.text + font: noiseReductionThresholdSliderText.font + } + RalewayRegular { + // The slider for my card is special, it controls the master gain + id: noiseReductionThresholdSliderText; + text: "Audio input threshold"; + size: 16; + anchors.left: parent.left; + color: hifi.colors.white; + horizontalAlignment: Text.AlignLeft; + verticalAlignment: Text.AlignTop; + } + } + + Separator { + id: thirdSeparator; + anchors.top: noiseReductionThresholdContainer.bottom; + anchors.topMargin: 14; + } Item { id: inputDeviceHeader x: margins.paddings; width: parent.width - margins.paddings*2; height: 36; - anchors.top: secondSeparator.bottom; + anchors.top: thirdSeparator.bottom; anchors.topMargin: 10; HiFiGlyphs { @@ -609,7 +749,7 @@ Rectangle { } Separator { - id: thirdSeparator; + id: fourthSeparator; anchors.top: inputView.bottom; anchors.topMargin: 10; } @@ -617,7 +757,7 @@ Rectangle { Item { id: outputDeviceHeader; anchors.topMargin: 10; - anchors.top: thirdSeparator.bottom; + anchors.top: fourthSeparator.bottom; x: margins.paddings; width: parent.width - margins.paddings*2 height: 36 diff --git a/interface/src/scripting/Audio.cpp b/interface/src/scripting/Audio.cpp index 36045bd8ec..d890069a61 100644 --- a/interface/src/scripting/Audio.cpp +++ b/interface/src/scripting/Audio.cpp @@ -314,7 +314,7 @@ void Audio::enableNoiseReductionAutomatic(bool enable) { } } -float Audio::getNoiseReductionThreshold() const { +float Audio::getNoiseReductionThreshold() { return resultWithReadLock([&] { return _noiseReductionThreshold; }); diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index cd1a2002ed..de66f6edf1 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -127,7 +127,6 @@ public: bool isMuted() const; bool noiseReductionEnabled() const; bool noiseReductionAutomatic() const; - float getNoiseReductionThreshold() const; bool warnWhenMutedEnabled() const; bool acousticEchoCancellationEnabled() const; float getInputVolume() const; @@ -274,6 +273,20 @@ public: * @returns {number} The injector gain (dB) in the client. */ Q_INVOKABLE float getSystemInjectorGain(); + + /**jsdoc + * Sets the noise gate threshold before your mic audio is transmitted. (Applies only if Audio.noiseReductionAutomatic is off.) + * @function Audio.setNoiseReductionThreshold + * @param {number} threshold - The level that your input must surpass to be transmitted. (0 - 1.0) + */ + Q_INVOKABLE void setNoiseReductionThreshold(float threshold); + + /**jsdoc + * Gets the noise reduction threshold. + * @function Audio.getNoiseReductionThreshold + * @returns {number} The noise reduction threshold. (0 - 1.0) + */ + Q_INVOKABLE float getNoiseReductionThreshold(); /**jsdoc * Starts making an audio recording of the audio being played in-world (i.e., not local-only audio) to a file in WAV format. @@ -535,7 +548,6 @@ private slots: void setMuted(bool muted); void enableNoiseReduction(bool enable); void enableNoiseReductionAutomatic(bool enable); - void setNoiseReductionThreshold(float threshold); void enableWarnWhenMuted(bool enable); void enableAcousticEchoCancellation(bool enable); void setInputVolume(float volume); From 5b1549a24e1f41674453d377758e71befe51a013 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Thu, 11 Feb 2021 05:59:08 -0500 Subject: [PATCH 04/13] Fix typo + update JSDoc. --- interface/src/scripting/Audio.cpp | 2 +- interface/src/scripting/Audio.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/scripting/Audio.cpp b/interface/src/scripting/Audio.cpp index d890069a61..ddcaef653c 100644 --- a/interface/src/scripting/Audio.cpp +++ b/interface/src/scripting/Audio.cpp @@ -332,7 +332,7 @@ void Audio::setNoiseReductionThreshold(float threshold) { } }); if (changed) { - emit noiseReductionAutomaticChanged(threshold); + emit noiseReductionThresholdChanged(threshold); } } diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index de66f6edf1..ae4e0f9d1a 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -277,14 +277,14 @@ public: /**jsdoc * Sets the noise gate threshold before your mic audio is transmitted. (Applies only if Audio.noiseReductionAutomatic is off.) * @function Audio.setNoiseReductionThreshold - * @param {number} threshold - The level that your input must surpass to be transmitted. (0 - 1.0) + * @param {number} threshold - The level that your input must surpass to be transmitted. 0.0 (open the gate completely) – 1.0 */ Q_INVOKABLE void setNoiseReductionThreshold(float threshold); /**jsdoc * Gets the noise reduction threshold. * @function Audio.getNoiseReductionThreshold - * @returns {number} The noise reduction threshold. (0 - 1.0) + * @returns {number} The noise reduction threshold. 0.01.0 */ Q_INVOKABLE float getNoiseReductionThreshold(); From 97fdd372af408f98e97fe595bdb25df194c4cb0d Mon Sep 17 00:00:00 2001 From: Kalila L Date: Thu, 11 Feb 2021 06:09:28 -0500 Subject: [PATCH 05/13] Fix Noise Reduction visibility in Audio.qml --- interface/resources/qml/hifi/audio/Audio.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 9f08f1bd3b..1d4b6f8a92 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -583,6 +583,7 @@ Rectangle { labelTextSize: 16; backgroundOnColor: "#E3E3E3"; checked: AudioScriptingInterface.noiseReductionAutomatic; + visible: AudioScriptingInterface.noiseReduction === true; onCheckedChanged: { AudioScriptingInterface.noiseReductionAutomatic = checked; checked = Qt.binding(function() { return AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding @@ -598,7 +599,7 @@ Rectangle { anchors.topMargin: 16; width: parent.width - margins.paddings*2; height: avatarGainSliderTextMetrics.height; - visible: AudioScriptingInterface.noiseReductionAutomatic !== true; + visible: AudioScriptingInterface.noiseReduction === true && AudioScriptingInterface.noiseReductionAutomatic !== true; HifiControlsUit.Slider { id: noiseReductionThresholdSlider From 799590a0fccde8342bd64f7e96855b1db2bf1412 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Thu, 11 Feb 2021 20:41:47 -0500 Subject: [PATCH 06/13] Add input level + gate indicator. --- interface/resources/qml/hifi/audio/Audio.qml | 103 +++++++++++++++++-- 1 file changed, 93 insertions(+), 10 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index 1d4b6f8a92..f98bce6b70 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -15,6 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 +import QtGraphicalEffects 1.0 import stylesUit 1.0 import controlsUit 1.0 as HifiControlsUit @@ -598,17 +599,17 @@ Rectangle { anchors.top: noiseReductionSwitches.bottom; anchors.topMargin: 16; width: parent.width - margins.paddings*2; - height: avatarGainSliderTextMetrics.height; + height: avatarGainSliderTextMetrics.height + 10; visible: AudioScriptingInterface.noiseReduction === true && AudioScriptingInterface.noiseReductionAutomatic !== true; HifiControlsUit.Slider { id: noiseReductionThresholdSlider anchors.right: parent.right - height: parent.height + height: noiseReductionThresholdSliderTextMetrics.height width: 200 minimumValue: 0.0 maximumValue: 1.0 - stepSize: 0.1 + stepSize: 0.05 value: AudioScriptingInterface.getNoiseReductionThreshold() onValueChanged: { updateNoiseReductionThresholdFromQML(value); @@ -653,6 +654,88 @@ Rectangle { horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignTop; } + + Item { + id: noisePeak + anchors.right: parent.right + anchors.rightMargin: 5; + anchors.top: noiseReductionThresholdSlider.bottom; + + width: noiseReductionThresholdSlider.width - 10; + height: 8; + + Text { + id: status; + + anchors { + horizontalCenter: parent.horizontalCenter; + verticalCenter: parent.verticalCenter; + } + + visible: AudioScriptingInterface.muted; + color: "#E2334D"; + + text: "MUTED"; + font.pointSize: 10; + } + + Item { + id: noiseBar; + + property bool gated: false; + property var level: AudioScriptingInterface.inputLevel; + + width: parent.width; + height: parent.height; + + anchors { fill: parent } + + visible: !status.visible; + + Component.onCompleted: { + AudioScriptingInterface.noiseGateOpened.connect(function() { noiseBar.gated = false; }); + AudioScriptingInterface.noiseGateClosed.connect(function() { noiseBar.gated = true; }); + AudioScriptingInterface.inputLevelChanged.connect(function() { noiseBar.level = AudioScriptingInterface.inputLevel; }); + } + + Rectangle { // base + radius: 4; + anchors { fill: parent } + color: colors.gutter; + } + + Rectangle { // noiseMask + id: noiseMask; + width: parent.width * noiseBar.level; + radius: 5; + anchors { + bottom: parent.bottom; + bottomMargin: 0; + top: parent.top; + topMargin: 0; + left: parent.left; + leftMargin: 0; + } + } + + LinearGradient { + anchors { fill: noiseMask } + source: noiseMask + start: Qt.point(0, 0); + end: Qt.point(noiseBar.width, 0); + gradient: Gradient { + GradientStop { + position: 0; + color: noiseBar.gated ? "#E2334D" : "#39A38F"; + } + GradientStop { + position: 1; + color: noiseBar.gated ? "#E2334D" : "#39A38F"; + } + } + } + } + } } Separator { @@ -738,13 +821,13 @@ Rectangle { } } AudioControls.InputPeak { - id: inputLevel - anchors.right: parent.right - peak: model.peak; - anchors.verticalCenter: parent.verticalCenter - visible: ((bar.currentIndex === 1 && isVR) || - (bar.currentIndex === 0 && !isVR)) && - AudioScriptingInterface.devices.input.peakValuesAvailable; + id: inputLevel + anchors.right: parent.right + peak: model.peak; + anchors.verticalCenter: parent.verticalCenter + visible: ((bar.currentIndex === 1 && isVR) || + (bar.currentIndex === 0 && !isVR)) && + AudioScriptingInterface.devices.input.peakValuesAvailable; } } } From 88b9ebb11aa50ee290e54655254e6731aea5406e Mon Sep 17 00:00:00 2001 From: Kalila L Date: Sat, 13 Feb 2021 17:17:27 -0500 Subject: [PATCH 07/13] Update Audio.qml "Noise Reduction: Manual/Automatic" -> "Manual Noise Reduction" --- interface/resources/qml/hifi/audio/Audio.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index f98bce6b70..b4e42d276f 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -580,14 +580,14 @@ Rectangle { anchors.top: noiseReductionSwitch.bottom; anchors.topMargin: 24; anchors.left: parent.left; - labelTextOn: "Noise Reduction: Manual/Automatic"; + labelTextOn: "Manual Noise Reduction"; labelTextSize: 16; backgroundOnColor: "#E3E3E3"; - checked: AudioScriptingInterface.noiseReductionAutomatic; + checked: !AudioScriptingInterface.noiseReductionAutomatic; visible: AudioScriptingInterface.noiseReduction === true; onCheckedChanged: { - AudioScriptingInterface.noiseReductionAutomatic = checked; - checked = Qt.binding(function() { return AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding + AudioScriptingInterface.noiseReductionAutomatic = !checked; + checked = Qt.binding(function() { return !AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding } } } @@ -663,7 +663,7 @@ Rectangle { width: noiseReductionThresholdSlider.width - 10; height: 8; - + Text { id: status; From 0a6e220c745e19f706d745c8ab4fd65493fab96c Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Tue, 23 Feb 2021 20:29:46 -0500 Subject: [PATCH 08/13] Apply suggestions from code review Co-authored-by: David Rowe --- interface/resources/qml/hifi/audio/Audio.qml | 32 ++++++++++---------- interface/src/scripting/Audio.h | 7 ++--- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/interface/resources/qml/hifi/audio/Audio.qml b/interface/resources/qml/hifi/audio/Audio.qml index b4e42d276f..1f20486e1e 100644 --- a/interface/resources/qml/hifi/audio/Audio.qml +++ b/interface/resources/qml/hifi/audio/Audio.qml @@ -106,7 +106,7 @@ Rectangle { } } function updateNoiseReductionThresholdFromQML(sliderValue) { - if (AudioScriptingInterface.getNoiseReductionThreshold() != sliderValue) { + if (AudioScriptingInterface.getNoiseReductionThreshold() !== sliderValue) { AudioScriptingInterface.setNoiseReductionThreshold(sliderValue); } } @@ -496,7 +496,7 @@ Rectangle { Item { id: noiseReductionHeader x: margins.paddings; - width: parent.width - margins.paddings*2; + width: parent.width - margins.paddings * 2; height: 36; anchors.top: secondSeparator.bottom; anchors.topMargin: 10; @@ -506,7 +506,7 @@ Rectangle { text: hifi.glyphs.mic; color: hifi.colors.white; anchors.left: parent.left; - anchors.leftMargin: -size/4; //the glyph has empty space at left about 25% + anchors.leftMargin: -size / 4; // The glyph has empty space at left about 25% anchors.verticalCenter: parent.verticalCenter; size: 30; } @@ -552,7 +552,7 @@ Rectangle { checked: AudioScriptingInterface.acousticEchoCancellation; onCheckedChanged: { AudioScriptingInterface.acousticEchoCancellation = checked; - checked = Qt.binding(function() { return AudioScriptingInterface.acousticEchoCancellation; }); + checked = Qt.binding(function () { return AudioScriptingInterface.acousticEchoCancellation; }); } } @@ -569,7 +569,7 @@ Rectangle { checked: AudioScriptingInterface.noiseReduction; onCheckedChanged: { AudioScriptingInterface.noiseReduction = checked; - checked = Qt.binding(function() { return AudioScriptingInterface.noiseReduction; }); // restore binding + checked = Qt.binding(function () { return AudioScriptingInterface.noiseReduction; }); // restore binding } } @@ -584,10 +584,10 @@ Rectangle { labelTextSize: 16; backgroundOnColor: "#E3E3E3"; checked: !AudioScriptingInterface.noiseReductionAutomatic; - visible: AudioScriptingInterface.noiseReduction === true; + visible: AudioScriptingInterface.noiseReduction; onCheckedChanged: { AudioScriptingInterface.noiseReductionAutomatic = !checked; - checked = Qt.binding(function() { return !AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding + checked = Qt.binding(function () { return !AudioScriptingInterface.noiseReductionAutomatic; }); // restore binding } } } @@ -598,9 +598,9 @@ Rectangle { x: margins.paddings; anchors.top: noiseReductionSwitches.bottom; anchors.topMargin: 16; - width: parent.width - margins.paddings*2; + width: parent.width - margins.paddings * 2; height: avatarGainSliderTextMetrics.height + 10; - visible: AudioScriptingInterface.noiseReduction === true && AudioScriptingInterface.noiseReductionAutomatic !== true; + visible: AudioScriptingInterface.noiseReduction && !AudioScriptingInterface.noiseReductionAutomatic; HifiControlsUit.Slider { id: noiseReductionThresholdSlider @@ -626,16 +626,16 @@ Rectangle { // Do nothing. } onDoubleClicked: { - noiseReductionThresholdSlider.value = 0.0 + noiseReductionThresholdSlider.value = 0.0; } onPressed: { // Pass through to Slider - mouse.accepted = false + mouse.accepted = false; } onReleased: { // the above mouse.accepted seems to make this // never get called, nonetheless... - mouse.accepted = false + mouse.accepted = false; } } } @@ -693,9 +693,9 @@ Rectangle { visible: !status.visible; Component.onCompleted: { - AudioScriptingInterface.noiseGateOpened.connect(function() { noiseBar.gated = false; }); - AudioScriptingInterface.noiseGateClosed.connect(function() { noiseBar.gated = true; }); - AudioScriptingInterface.inputLevelChanged.connect(function() { noiseBar.level = AudioScriptingInterface.inputLevel; }); + AudioScriptingInterface.noiseGateOpened.connect(function () { noiseBar.gated = false; }); + AudioScriptingInterface.noiseGateClosed.connect(function () { noiseBar.gated = true; }); + AudioScriptingInterface.inputLevelChanged.connect(function () { noiseBar.level = AudioScriptingInterface.inputLevel; }); } Rectangle { // base @@ -908,4 +908,4 @@ Rectangle { } } } -} \ No newline at end of file +} diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index ae4e0f9d1a..078e7561a8 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -275,7 +275,7 @@ public: Q_INVOKABLE float getSystemInjectorGain(); /**jsdoc - * Sets the noise gate threshold before your mic audio is transmitted. (Applies only if Audio.noiseReductionAutomatic is off.) + * Sets the noise gate threshold before your mic audio is transmitted. (Applies only if Audio.noiseReductionAutomatic is false.) * @function Audio.setNoiseReductionThreshold * @param {number} threshold - The level that your input must surpass to be transmitted. 0.0 (open the gate completely) – 1.0 */ @@ -419,14 +419,13 @@ signals: /**jsdoc * Triggered when the audio input noise reduction mode is changed. * @function Audio.noiseReductionAutomaticChanged - * @param {boolean} isEnabled - true if audio input noise reduction automatic mode is enabled, otherwise false. - * This means the mode is set to 'manual'. + * @param {boolean} isEnabled - true if audio input noise reduction automatic mode is enabled, false if in manual mode. * @returns {Signal} */ void noiseReductionAutomaticChanged(bool isEnabled); /**jsdoc - * Triggered when audio input noise reduction threshold is changed. + * Triggered when the audio input noise reduction threshold is changed. * @function Audio.noiseReductionThresholdChanged * @param {number} threshold - The threshold for the audio input noise reduction, range 0.0 (open the gate completely) – 1.0 * (close the gate completely). From 83c8b71fa5e76fbb1abab231df0cbe73cc63a4b4 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Wed, 24 Feb 2021 00:58:50 -0500 Subject: [PATCH 09/13] Add missing JSDocs. --- interface/src/scripting/Audio.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index 078e7561a8..2b068b195c 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -50,6 +50,11 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * @property {boolean} noiseReduction - true if noise reduction is enabled, otherwise false. When * enabled, the input audio signal is blocked (fully attenuated) when it falls below an adaptive threshold set just * above the noise floor. + * @property {boolean} noiseReductionAutomatic - true if audio input noise reduction automatic mode is enabled, + * false if in manual mode. Manual mode will allow you to use Audio.noiseReductionAutomatic + * to set a manual sensitivity for the noise gate. + * @property {number} noiseReductionThreshold - Sets the noise gate threshold before your mic audio is transmitted. + * (Applies only if Audio.noiseReductionAutomatic is false.) * @property {number} inputVolume - Adjusts the volume of the input audio, range 0.01.0. * If set to a value, the resulting value depends on the input device: for example, the volume can't be changed on some * devices, and others might only support values of 0.0 and 1.0. From 61defe74ce1348e77fe144d63b4686b3af6a3af3 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Wed, 24 Feb 2021 15:32:36 -0500 Subject: [PATCH 10/13] Update interface/src/scripting/Audio.h Co-authored-by: David Rowe --- interface/src/scripting/Audio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index 2b068b195c..707c8aac33 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -51,7 +51,7 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * enabled, the input audio signal is blocked (fully attenuated) when it falls below an adaptive threshold set just * above the noise floor. * @property {boolean} noiseReductionAutomatic - true if audio input noise reduction automatic mode is enabled, - * false if in manual mode. Manual mode will allow you to use Audio.noiseReductionAutomatic + * false if in manual mode. Manual mode allows you to use Audio.noiseReductionThreshold * to set a manual sensitivity for the noise gate. * @property {number} noiseReductionThreshold - Sets the noise gate threshold before your mic audio is transmitted. * (Applies only if Audio.noiseReductionAutomatic is false.) From 520d21b7978f59f2e32058dc3940c764e38d889c Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Thu, 25 Feb 2021 23:15:36 -0500 Subject: [PATCH 11/13] Update Audio.cpp --- interface/src/scripting/Audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/scripting/Audio.cpp b/interface/src/scripting/Audio.cpp index ddcaef653c..6277ab8b5d 100644 --- a/interface/src/scripting/Audio.cpp +++ b/interface/src/scripting/Audio.cpp @@ -26,7 +26,7 @@ QString Audio::HMD { "VR" }; Setting::Handle enableNoiseReductionSetting { QStringList { Audio::AUDIO, "NoiseReduction" }, true }; Setting::Handle enableNoiseReductionAutomaticSetting { QStringList { Audio::AUDIO, "NoiseReductionAutomatic" }, false }; -Setting::Handle setNoiseReductionThresholdSetting { QStringList { Audio::AUDIO, "NoiseReductionThreshold" }, 0.2f }; +Setting::Handle setNoiseReductionThresholdSetting { QStringList { Audio::AUDIO, "NoiseReductionThreshold" }, 0.1f }; Setting::Handle enableWarnWhenMutedSetting { QStringList { Audio::AUDIO, "WarnWhenMuted" }, true }; Setting::Handle enableAcousticEchoCancellationSetting { QStringList { Audio::AUDIO, "AcousticEchoCancellation" }, true }; From 4dd3ee6e1e212f14c928c600462687e77907cfe0 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Wed, 3 Mar 2021 02:47:19 -0500 Subject: [PATCH 12/13] "Test your voice" now takes into account noise gate state. --- libraries/audio-client/src/AudioClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index a3d2568b6d..38635870fd 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -1266,7 +1266,7 @@ void AudioClient::processWebrtcNearEnd(int16_t* samples, int numFrames, int numC void AudioClient::handleLocalEchoAndReverb(QByteArray& inputByteArray) { // If there is server echo, reverb will be applied to the recieved audio stream so no need to have it here. bool hasReverb = _reverb || _receivedAudioStream.hasReverb(); - if ((_muted && !_shouldEchoLocally) || !_audioOutput || (!_shouldEchoLocally && !hasReverb)) { + if ((_muted && !_shouldEchoLocally) || !_audioOutput || (!_shouldEchoLocally && !hasReverb) || !_audioGateOpen) { return; } From 809bd936d304b575526b0007cad98c977ec0a001 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Wed, 3 Mar 2021 21:17:17 -0500 Subject: [PATCH 13/13] Update Audio.cpp Fix default value for "NoiseReductionAutomatic" to true. --- interface/src/scripting/Audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/scripting/Audio.cpp b/interface/src/scripting/Audio.cpp index 6277ab8b5d..4a96e36939 100644 --- a/interface/src/scripting/Audio.cpp +++ b/interface/src/scripting/Audio.cpp @@ -25,7 +25,7 @@ QString Audio::DESKTOP { "Desktop" }; QString Audio::HMD { "VR" }; Setting::Handle enableNoiseReductionSetting { QStringList { Audio::AUDIO, "NoiseReduction" }, true }; -Setting::Handle enableNoiseReductionAutomaticSetting { QStringList { Audio::AUDIO, "NoiseReductionAutomatic" }, false }; +Setting::Handle enableNoiseReductionAutomaticSetting { QStringList { Audio::AUDIO, "NoiseReductionAutomatic" }, true }; Setting::Handle setNoiseReductionThresholdSetting { QStringList { Audio::AUDIO, "NoiseReductionThreshold" }, 0.1f }; Setting::Handle enableWarnWhenMutedSetting { QStringList { Audio::AUDIO, "WarnWhenMuted" }, true }; Setting::Handle enableAcousticEchoCancellationSetting { QStringList { Audio::AUDIO, "AcousticEchoCancellation" }, true };