Agora supports the media device test and selection, allowing you to check if a camera or an audio device (a headeset, microphone, or speaker) functions well or connects properly to the SD-RTN. For example, in an audio device test, if a user's speech can be replayed in 10 seconds, then the system's audio device is properly connected to the SD-RTN.
You can use the media device test and selection feature in the following scenarios:
- As a host in a live broadcast, do a self-check before airing the broadcast.
- As an online user, check if the media device works well.
// Start the echo test. rtcEngine.startEchoTest(); // Wait and check if you can hear your voice. // Stop the echo test. rtcEngine.stopEchoTest();
- After calling the
startEchoTestmethod to start the test, you must call the
stopEchoTestmethod to stop the test. Otherwise, you cannot proceed with a second test or call the
joinChannelmethod to make a call.
- In the Live Broadcast profile, only the host (BROADCASTER) can call the
startEchoTestmethod. If you swtiched your profile from Communication to Live Broadcast, ensure that you call the
setClientRolemethod to switch your role to BROADCASTER before calling the