Is there a way to get the ID of the current speaker?

Is there a way to get the ID of the current speaker in conference.js? I want to display their name in the UI for the active speaker but need their ID to call getParticipantDisplayName(id)

An idea I had was to use the dominant_speaker_changed event which gives access to the id of the current dominant speaker but ideally is there a function available like getActiveParticipantId or something that I could simply call.

@damencho @saghul any guidance please. this is high priority for me right now

I suggest you keep track of the active speaker with dominant_speaker_changed yoursdelf and operate on that.

but if there is just 1 person in the meeting, dominant_speaker_changed doesn’t fire because they never change. I have a use case where I need to trigger events when the speaker starts talking and when they end talking.

I could use dominant_speaker_changed to trigger the start event but if theres just 1 person in a meeting, the dominant speaker would never change, hence not allowing me to fire my stopped speaking event.

is there any other way to do this?

We don’t have that ability per se. Can you please describe exactly what you are trying to accomplish? There might be some other way…

I basically want to send speaker events to my backend api. So the events I need are when a user begins speaking and when they stop speaking.

One way I was doing it was using the Track_Audio_Level_Changed where I was pushing a start speaking event when the audio level for a user was above like 0.2 or something and then a stop speaking event when the audio level fell below 0.0002…but this isn’t too accurate…

and when I call these events I want that active user’s displayname, which was my original question
@saghul any ideas?

Hey! did you manage to figure out any solution for this? I am figuring out the same.

1 Like