Skip to main content

Device Detection

This feature is supported starting from SDK version 5.2.5.

Before initiating a call or live streaming, users can check whether their devices are functioning properly using the device detection interface.

Microphone & Speaker Test

Developers can test microphone and speaker functionality by calling the startEchoTest method of the RCRTCEngine object. The timeInterval parameter specifies the recording duration in seconds (valid range: [2,10]). After invocation, users should speak into the microphone. If the recorded audio plays back normally, it confirms both microphone and speaker are working correctly. Note: The startEchoTest process must be terminated by calling stopEchoTest to avoid interfering with other operations.

  • Sample code:

    // Start echo test. 10 indicates the microphone will record for 10 seconds before playback. 
    // Hearing the playback confirms normal microphone and speaker functionality.
    engine.startEchoTest(10);
    // Wait and verify if the audio playback is audible
    // Terminate the test
    engine.stopEchoTest();