diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-12-07 19:47:37 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 23:11:36 -0800 |
commit | b58342a4e08c3adecb9da6d53aae791cc29a917b (patch) | |
tree | b3a1a0cfe4a64c5709d95da74d2f457b55cc4f00 /indra/llwebrtc | |
parent | 86b549cb793c3a368c266893d21c0ad8902863ef (diff) |
Rework VU meter level processing to be closer to Vivox
Diffstat (limited to 'indra/llwebrtc')
-rw-r--r-- | indra/llwebrtc/llwebrtc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 9fd8fd8ee6..32a75d3675 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -54,7 +54,7 @@ void LLAudioDeviceObserver::OnCaptureData(const void *audio_samples, const short *samples = (const short *) audio_samples; for (size_t index = 0; index < num_samples * num_channels; index++) { - float sample = (static_cast<float>(samples[index]) / (float) 32768); + float sample = (static_cast<float>(samples[index]) / (float) 32767); energy += sample * sample; } @@ -384,9 +384,9 @@ void LLWebRTCImpl::setTuningMode(bool enable) } } -float LLWebRTCImpl::getTuningAudioLevel() { return 20 * mTuningAudioDeviceObserver->getMicrophoneEnergy(); } +float LLWebRTCImpl::getTuningAudioLevel() { return -20 * log10f(mTuningAudioDeviceObserver->getMicrophoneEnergy()); } -float LLWebRTCImpl::getPeerAudioLevel() { return 20 * mPeerAudioDeviceObserver->getMicrophoneEnergy(); } +float LLWebRTCImpl::getPeerAudioLevel() { return -20 * log10f(mPeerAudioDeviceObserver->getMicrophoneEnergy()); } // // Helpers |