onActiveSpeaker property

(void Function(RtcConnection connection, int uid)?) onActiveSpeaker
final

Occurs when the most active remote speaker is detected. After a successful call of enableAudioVolumeIndication , the SDK continuously detects which remote user has the loudest volume. During the current period, the remote user, who is detected as the loudest for the most times, is the most active user.When the number of users is no less than two and an active remote speaker exists, the SDK triggers this callback and reports the uid of the most active remote speaker.If the most active remote speaker is always the same user, the SDK triggers the onActiveSpeaker callback only once.If the most active remote speaker changes to another user, the SDK triggers this callback again and reports the uid of the new active remote speaker.

  • connection The connection information. See RtcConnection .
  • uid The user ID of the most active remote speaker.

Implementation

final void Function(RtcConnection connection, int uid)? onActiveSpeaker;