summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicewebrtc.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2023-09-26 16:37:24 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-02-08 18:34:01 -0800
commit819a715a59b9926f64ba62b28299849868e577e2 (patch)
tree198497c1090fe20835984e5c44900c270c02edef /indra/newview/llvoicewebrtc.cpp
parent025e9dcc4d898a7a66c55040903f5d1f9a6d4d7f (diff)
sdd stereo support to client
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r--indra/newview/llvoicewebrtc.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 4c687b5807..a1e63c29cf 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -2208,10 +2208,10 @@ void LLWebRTCVoiceClient::sendPositionAndVolumeUpdate(void)
{
audio_level = (F32) mWebRTCDeviceInterface->getAudioLevel();
}
- uint32_t uint_audio_level = (uint32_t) (audio_level * 256);
+ uint32_t uint_audio_level = mMuteMic ? 0 : (uint32_t) (audio_level * 128);
if (uint_audio_level != mAudioLevel)
{
- root["p"] = uint_audio_level;
+ root["p"] = uint_audio_level;
mAudioLevel = uint_audio_level;
participantStatePtr_t participant = findParticipantByID(gAgentID);
if (participant)
@@ -2530,7 +2530,7 @@ void LLWebRTCVoiceClient::OnDataReceived(const std::string& data, bool binary)
{
removeParticipantByID(agent_id);
}
- F32 energyRMS = (F32) (voice_data[participant_id].get("p", Json::Value(participant->mPower)).asInt()) / 256;
+ F32 energyRMS = (F32) (voice_data[participant_id].get("p", Json::Value(participant->mPower)).asInt()) / 128;
// convert to decibles
participant->mPower = energyRMS;
/* WebRTC appears to have deprecated VAD, but it's still in the Audio Processing Module so maybe we
@@ -4487,13 +4487,10 @@ BOOL LLWebRTCVoiceClient::getIsModeratorMuted(const LLUUID& id)
F32 LLWebRTCVoiceClient::getCurrentPower(const LLUUID &id)
{
F32 result = 0;
- if (!mMuteMic)
+ participantStatePtr_t participant(findParticipantByID(id));
+ if (participant)
{
- participantStatePtr_t participant(findParticipantByID(id));
- if (participant)
- {
- result = participant->mPower * 4;
- }
+ result = participant->mPower * 3.5;
}
return result;
}