startAudioDeviceLoopbackTest abstract method

Future<void> startAudioDeviceLoopbackTest(
  1. int indicationInterval
)

Starts the audio device loopback test.

This method tests whether the audio recording and playback devices are working properly. Once the test starts, the recording device captures local audio and the playback device plays it back. The SDK triggers two onAudioVolumeIndication callbacks at the specified interval, reporting the volume information of the recording device (uid = 0) and the playback device (uid = 1). (Windows and macOS only) Can be called before or after joining a channel. Only supported for the broadcaster role. This method only tests local audio devices and does not involve network connection. After the test is complete, you must call stopAudioDeviceLoopbackTest to stop the loopback test.

  • indicationInterval The time interval (in milliseconds) at which the SDK triggers the onAudioVolumeIndication callback. It is recommended to set it greater than 200 ms. It must not be less than 10 ms, otherwise the onAudioVolumeIndication callback will not be received.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> startAudioDeviceLoopbackTest(int indicationInterval);