onUserVoiceVolume property

(void Function(List<TRTCVolumeInfo> userVolumes, int totalVolume)?) onUserVoiceVolume
final

Volume

The SDK can assess the volume of each channel and return this callback on a regular basis. You can display, for example, a waveform or volume bar on the UI based on the statistics returned.

You need to first call enableAudioVolumeEvaluation to enable the feature and set the interval for the callback.

Note that the SDK returns this callback at the specified interval regardless of whether someone is speaking in the room.

  • Parameters:
    • totalVolume(int):
      • The total volume of all remote users. Value range: 0-100.
    • userVolumes(List<TRTCVolumeInfo>):
      • An array that represents the volume of all users who are speaking in the room.

Note userVolumes is an array. If userId is empty, the elements in the array represent the volume of the local user’s audio. Otherwise, they represent the volume of a remote user’s audio.

Implementation

final void Function(List<TRTCVolumeInfo> userVolumes, int totalVolume)? onUserVoiceVolume;