🩹(frontend) add participant audio leveling#1347
Conversation
There was a problem hiding this comment.
Hi. Thank you for your PR. This would be nice feature. I did not try this out yet.
I have a few comments/questions:
-
Do you have a reference for property
audioLevelbeing used ? I have trouble finding a definitive answer on whether this is a smoothed value already. I guess yes, since values are btw 0 and 1, but it would be nice to confirm what it actually corresponds to. -
Do you have insight for the proposed constants ? How did you choose these values ?
-
SMOOTHING_FACTOR / UPDATE_INTERVAL_MS with current values means corrections can be long (5 seconds from 0.02 to 0.3, with target 0.35). While this is okay for volume increase, it seems like a long wait if sound is too loud. Perhaps, volume decrease can be sped up.
-
Additional comment: We should be careful that this integrates properly with participant muting to come
|
|
@cameledev Thanks for the review. On I have not found a definitive reference confirming whether that value is already smoothed server-side, or whether it represents RMS/peak/VAD-derived level. So I treated it as a LiveKit-provided relative activity/loudness signal rather than a calibrated loudness value. On the constants: they are conservative MVP values rather than calibrated audio-normalization constants.
Your point about correction speed makes sense. I updated the smoothing to be asymmetric: attenuation is faster when a participant is too loud, while recovery is slower to avoid audible pumping. That should make loud-participant correction more responsive without making the volume jump around. On participant muting: the current implementation only touches remote microphone track playback volume and resets touched |



Purpose
Adds an optional participant audio leveling setting for calls, addressing #1345.
Proposal
Automatically equalize participant audio levels
Changes
Safety
This MVP is attenuation-only.
MAX_GAINis capped at1, so the hook never setsHTMLMediaElement.volumeabove the safe browser limit.