Skip to main content
getRemoteParticipantsAudioLevel() Returns the latest audio level for each remote participant. You must call startRemoteParticipantsAudioLevelObserver() before calling this method — otherwise it returns an empty object. This method is synchronous — it does not return a Promise.

Return value

Returns a DailyParticipantsAudioLevel object: a map of participant session IDs to audio level values. Each value is a number between 0.0 (silence) and 1.0 (maximum volume).

Example

await call.startRemoteParticipantsAudioLevelObserver(100);

const levels = call.getRemoteParticipantsAudioLevel();
// {
//   "03ec86c3-59cc-4bea-a61b-f8ffae9a2989": 0.28,
//   "5e1fa0e9-cce6-45a0-ba61-f64d24b41ff6": 0
// }

const activeSpeakerId = Object.entries(levels)
  .sort(([, a], [, b]) => b - a)[0]?.[0];

See also