Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now


Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Detecting the Dominant Speaker

This guide introduces the Dominant Speaker Detection API and provides guidance on how to use it effectively in your Twilio Video applications. The Dominant Speaker API is only available in Group Rooms.

In a multi-party video application, the dominant speaker is the Participant sharing the loudest audio track in the Room. The Dominant Speaker Detection API sends events to your application every time the dominant speaker changes. Developers can use those events to improve the end user's experience by bringing into focus the speakers published video tracks.


The Room.dominantSpeaker property (Android, (iOS, JavaScript) represents the RemoteParticipant with the loudest RemoteAudioTrack. Whenever the Dominant Speaker changes, the Room emits a dominantSpeakerChanged event.

Note: dominantSpeakerChanged events are emitted in Group Rooms with 2 or more Participants.

Enabling Dominant Speaker Detection

The Dominant Speaker API is disabled by default, and is requested at connect time. The following table illustrates the currently supported platforms:

Twilio Video SDK Dominant Speaker API support (Group Rooms)
Android Yes (v4.3.0+)
iOS Yes (v2.8.0+)
JavaScript Yes (v1.14.0+)


When building ConnectOptions, set the property enableDominantSpeaker to true.

 ConnectOptions connectOptions =
        new ConnectOptions.Builder(token)
Room room = Video.connect(context, connectOptions, roomListener);

Implement Room.Listener#onDominantSpeakerChanged(@NonNull Room room, @Nullable RemoteParticipant remoteParticipant) in order to respond to speaker events.

void onDominantSpeakerChanged(
                @NonNull Room room, @Nullable RemoteParticipant remoteParticipant) {
                // Handle dominant speaker change


When building TVIConnectOptions, set the property isDominantSpeakerEnabled to true.

let options = TVIConnectOptions(token: accessToken) { (builder) in

    // Enable Dominant Speaker functionality
    builder.isDominantSpeakerEnabled = true

    if let localAudioTrack = self.localAudioTrack {
        builder.audioTracks = [localAudioTrack]
    builder.roomName = "my-conference-room"

room = TwilioVideo.connect(with: options, delegate: self)

Implement -[TVIRoomDelegate room:dominantSpeakerDidChange:] in order to respond to speaker events.

// MARK: TVIRoomDelegate
func room(_ room: TVIRoom, dominantSpeakerDidChange participant: TVIRemoteParticipant?) {
    var identity = "N/A"

    if let participant = participant {
        identity = participant.identity

    print("Dominant Speaker Changed: \(identity)")


In the connect method, set the property dominantSpeaker to true to enable the Dominant Speaker API and to start receiving dominantSpeakerChanged events.

var Video = require('twilio-video');
var token = getAccessToken();

// Connect with custom names for LocalAudioTrack and LocalVideoTrack
Video.connect(token, {
  name: 'my-conference-room'
  audio: { name: 'microphone' },
  video: { name: 'camera' },
  dominantSpeaker: true
}).then(function(room) {
  room.on('dominantSpeakerChanged', participant => {
    console.log('The new dominant speaker in the Room is:', participant);
Rate this page:


誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。