startHardwareEchoDetection abstract method

Future<int?> startHardwareEchoDetection(
  1. String testAudioFilePath
)

Starts echo detection before joining a room.

testAudioFilePath: Absolute path of the music file for the detection, which is expected to encode with UTF-8. The following files are supported: mp3, aac, m4a, 3gp, wav.
We recommend you assign a music file whose duration is between 10 to 20 seconds.
Do not pass a Silent file.

Return value:

  • 0: Success.
  • -1: Failure due to the ongoing process of the previous detection. Call stopHardwareEchoDetection to stop it before calling this API again.
  • -2: Failure due to an invalid file path or file format.

Notes:

  • You can use this feature only when RoomProfile is set to meeting or meetingroom.
  • Before calling this API, ask the user for the permissions to access the local audio devices.
  • Before calling this api, make sure the audio devices are activate and keep the capture volume and the playback volume within a reasonable range.
  • The detection result is passed as the argument of RTCVideoEventHandler.onHardwareEchoDetectionResult.
  • During the detection, the SDK is not able to response to the other testing API such as startEchoTest.
  • Call stopHardwareEchoDetection to stop the detection and release the audio devices.

Implementation

Future<int?> startHardwareEchoDetection(String testAudioFilePath);