rtcEngine$onHardwareEchoDetectionResult method

FutureOr<void> rtcEngine$onHardwareEchoDetectionResult(
  1. dynamic engine,
  2. dynamic result
)
override

@detail callback @author zhangcaining @brief 通话前回声检测结果回调。 @param engine ByteRTCEngine 实例 @param result 参见 ByteRTCHardwareEchoDetectionResult{@link #ByteRTCHardwareEchoDetectionResult}。 @note - 通话前调用 startHardwareEchoDetection:{@link #ByteRTCEngine#startHardwareEchoDetection} 后,将触发本回调返回检测结果。 - 建议在收到检测结果后,调用 stopHardwareEchoDetection{@link #ByteRTCEngine#stopHardwareEchoDetection} 停止检测,释放对音频设备的占用。 - 如果 SDK 在通话中检测到回声,将通过 rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning:{@link #ByteRTCEngineDelegate#rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning} 回调 ByteRTCMediaDeviceWarningDetectLeakEcho

Implementation

FutureOr<void> rtcEngine$onHardwareEchoDetectionResult(
    dynamic engine, dynamic result) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler)
      .onHardwareEchoDetectionResult
      ?.call(t_HardwareEchoDetectionResult.ios_to_code($p_i
          .ByteRTCHardwareEchoDetectionResult.values
          .firstWhere((t) => t.$value == result || t.name == result)));
}