Active Speaker Indication - Android
Active speaker indication tells you which participant is speaking, so you can highlight their tile. This helps most in large rooms and webinars.
When a participant starts speaking, the onSpeakerChanged event of RoomEventListener is called with their participant ID as activeSpeakerId. It is called with null when nobody is speaking.
For example, in a room with Alice and Bob, onSpeakerChanged is called with Alice's ID when she speaks, and with Bob's ID when he speaks.
To read the current speaker at any time, call room.getActiveSpeakerId().
Event
private val roomEventListener: RoomEventListener = object : RoomEventListener() {
override fun onSpeakerChanged(activeSpeakerId: String?) {
Toast.makeText(this@MainActivity, "Active speaker: $activeSpeakerId", Toast.LENGTH_SHORT).show()
super.onSpeakerChanged(activeSpeakerId)
}
}
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord

