rtcEngine$onHardwareEchoDetectionResult method

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

@detail callback @brief Callback that notifies you the result of the echo detection before a call @param engine ByteRTCEngine object. @param result Refer to ByteRTCHardwareEchoDetectionResult{@link #ByteRTCHardwareEchoDetectionResult} for more details. @note - This callback notifies you the result of the echo detection by calling startHardwareEchoDetection:{@link #ByteRTCEngine#startHardwareEchoDetection}. - We recommend to call stopHardwareEchoDetection{@link #ByteRTCEngine#stopHardwareEchoDetection} to stop the detection. - Listen to ByteRTCMediaDeviceWarningDetectLeakEcho in the callback of rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning:{@link #ByteRTCEngineDelegate#rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning} for the echo issue during a call.

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)));
}