enableAudioVolumeIndication method

  1. @override
Future<void> enableAudioVolumeIndication(
  1. int interval,
  2. int smooth,
  3. bool report_vad
)

Enables the RtcEngineEventHandler.audioVolumeIndication callback at a set time interval to report on which users are speaking and the speakers' volume.

Once this method is enabled, the SDK returns the volume indication in the RtcEngineEventHandler.audioVolumeIndication callback at the set time interval, regardless of whether any user is speaking in the channel.

Parameter interval Sets the time interval between two consecutive volume indications:

  • ≤ 0: Disables the volume indication.
  • 0: Time interval (ms) between two consecutive volume indications. We recommend setting interval ≥ 200 ms.

Parameter smooth The smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3.

Parameter report_vad

  • true: Enable the voice activity detection of the local user. Once it is enabled, the vad parameter of the RtcEngineEventHandler.audioVolumeIndication callback reports the voice activity status of the local user.
  • false: (Default) Disable the voice activity detection of the local user. Once it is disabled, the vad parameter of the RtcEngineEventHandler.audioVolumeIndication callback does not report the voice activity status of the local user, except for scenarios where the engine automatically detects the voice activity of the local user.

Implementation

@override
Future<void> enableAudioVolumeIndication(
    int interval, int smooth, bool report_vad) {
  return _invokeMethod('enableAudioVolumeIndication',
      {'interval': interval, 'smooth': smooth, 'report_vad': report_vad});
}