enableAudioVolumeEvaluation method

Future<void> enableAudioVolumeEvaluation(
  1. int intervalMs
)

开启麦克风音量检测功能

启用此功能后,将在 TRTCCloudListener.onUserVoiceVolume 中获取 SDK 对音量的评估结果。要启用此功能,请在调用 startLocalAudio() 之前调用此 API。

参数:

intervalMs 决定触发 onUserVoiceVolume 回调的间隔(以毫秒为单位)。最小间隔为 100 毫秒。如果值小于 0,则禁用回调。建议您将此参数设置为 300 毫秒。有关回调规则的详细信息,请参阅 onUserVoiceVolume 的描述。

Implementation

Future<void> enableAudioVolumeEvaluation(
    int intervalMs // Determines the interval in ms for triggering the `onUserVoiceVolume` callback. The minimum interval is 100 ms. If the value is smaller than 0, the callback will be disabled. We recommend you set this parameter to 300 ms. For detailed callback rules, please see the description of `onUserVoiceVolume`.
    ) {
  return _cloudChannel.invokeMethod('enableAudioVolumeEvaluation', {
    "intervalMs": intervalMs,
  });
}