Agora supports the media device test and selection feature, allowing you to check if an audio device (a headset, microphone, or speaker) works or connects properly to the SD-RTN. For example, in an audio device test, if a user's recorded voice is replayed in 10 seconds, then the system's audio device works and is connected properly to the SD-RTN.
You can use the media device test and selection feature in the following scenarios:
- A host self-checks before starting a live broadcast.
- An online user checks if the media device works.
// 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