summaryrefslogtreecommitdiff
path: root/indra/llwebrtc/llwebrtc_impl.h
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-06-24 14:42:30 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-06-24 14:42:30 -0700
commit34a2fd525f5dde075bfc5615e6deb241ae61b94c (patch)
tree7696d3de36f30897bce1eb9ce6ae5e5bed95c76c /indra/llwebrtc/llwebrtc_impl.h
parentd8fdf5acf8f87bdcef591b4870d229ec34642aec (diff)
[WebRTC] control microphone gain via custom audio processor.
Previously, there were two places audio gain could be controlled: - the device manager - the audio track The device manager audio gain control sets the system gain for all applications, not just the webrtc application. The audio track gain happens well after the audio processing where we want it to happen. So, gain control was added to the existing custom audio processor, which previously only handled calculating and retrieving the audio levels. After these changes, the microphone gain slider does impact the audio volume heard by peers.
Diffstat (limited to 'indra/llwebrtc/llwebrtc_impl.h')
-rw-r--r--indra/llwebrtc/llwebrtc_impl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h
index 448d36e3ea..6672f8ce90 100644
--- a/indra/llwebrtc/llwebrtc_impl.h
+++ b/indra/llwebrtc/llwebrtc_impl.h
@@ -121,6 +121,8 @@ class LLCustomProcessor : public webrtc::CustomProcessing
float getMicrophoneEnergy() { return mMicrophoneEnergy; }
+ void setGain(float gain) { mGain = gain; }
+
protected:
static const int NUM_PACKETS_TO_FILTER = 30; // 300 ms of smoothing
int mSampleRateHz;
@@ -128,6 +130,7 @@ class LLCustomProcessor : public webrtc::CustomProcessing
float mSumVector[NUM_PACKETS_TO_FILTER];
float mMicrophoneEnergy;
+ float mGain;
};
@@ -160,6 +163,8 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS
float getTuningAudioLevel() override;
float getPeerConnectionAudioLevel() override;
+ void setPeerConnectionGain(float gain) override;
+
//
// AudioDeviceSink
//