summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicewebrtc.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-02-04 15:49:27 -0800
committerRoxie Linden <roxie@lindenlab.com>2024-02-08 18:35:55 -0800
commit33937833b7c07f4807fc78ba06b917c968b1f0f8 (patch)
treef9249852d7a06867b697b90f4a151aaee72b0b42 /indra/newview/llvoicewebrtc.cpp
parent73b00bfe94a6a2a4ea0abc2cf716d835820dfdba (diff)
Add server-generate VAD
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r--indra/newview/llvoicewebrtc.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 9304ce4740..c70a60748d 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -2951,7 +2951,7 @@ void LLVoiceWebRTCConnection::OnDataReceived(const std::string &data, bool binar
F32 volume;
if(LLSpeakerVolumeStorage::getInstance()->getSpeakerVolume(agent_id, volume))
{
- user_gain[participant_id] = volume;
+ user_gain[participant_id] = uint16_t(volume*200);
}
}
@@ -2974,9 +2974,11 @@ void LLVoiceWebRTCConnection::OnDataReceived(const std::string &data, bool binar
F32 level = (F32) (voice_data[participant_id].get("p", Json::Value(participant->mLevel)).asInt()) / 128;
// convert to decibles
participant->mLevel = level;
- /* WebRTC appears to have deprecated VAD, but it's still in the Audio Processing Module so maybe we
- can use it at some point when we actually process frames. */
- participant->mIsSpeaking = participant->mLevel > SPEAKING_AUDIO_LEVEL;
+
+ if (voice_data["participant_id"].isMember("v"))
+ {
+ participant->mIsSpeaking = voice_data[participant_id].get("v", Json::Value(false)).asBool();
+ }
}
}
}