In real-time engagements, the audio signal often produces echoes due to the following circumstances:
- A local user sends an audio signal to a remote user, which the remote user plays through a speakerphone or similar external device.
- The audio signal played by the speakerphone is reflected in the room and captured by the remote user’s microphone.
- The remote user sends the audio captured by the microphone to the local user, so the local user hears their own echoes and the audio of the remote user.
The Agora Video SDK enables its own echo cancellation algorithm by default. In indoor scenarios such as conferences or hybrid-learning classrooms, however, factors such as unfavorable environmental factors and the use of multiple external audio devices can reduce the effectiveness of the echo cancellation. This page describes how to avoid echoes in indoor scenarios.
Any reflective materials in the indoor environment can easily produce echoes. Agora recommends choosing an environment for real-time engagements according to the following guidelines:
- Choose an environment that contains sound-absorbing materials for the best results.
- If that is not available, an environment without glass windows, glass whiteboards, or other reflective materials is the next best choice.
- If reflective objects or surfaces are in the environment, Agora recommends covering them with non-reflective materials such as curtains.
In scenarios such as conferences or hybrid-learning classrooms, users often need to connect external audio devices such as projectors and microphones, which can be divided into the following general categories:
- External capture devices, such as external microphones.
- External playback devices, such as projectors with speakerphones.
- External processors, such as sound cards, or external capture or playback devices with processors.
If a user captures and plays audio through different devices, this causes delay jitter between the playback and captured signals, which affects the SDK echo cancellation. To avoid delay jitter, Agora recommends using the same device to capture and play audio. For example, if a projector with speakerphone is connected to the user's computer, Agora recommends setting both the audio capture and playback device to either the computer or the projector.
If the user uses an external audio processor, the app uses the echo cancellation algorithms of both the SDK and the external audio processor. The superposition of the algorithms might over-process the audio and increase the CPU usage.
Agora recommends the following steps to test and select an external audio processor:
- Connect an external audio processor, and start real-time audio engagement through the app that is integrated with the SDK.
- Disconnect that external audio processor, and start real-time audio engagement through the app that is integrated with the SDK.
- Compare the audio experiences of step 1 and step 2.
- If the audio experience in step 1 is better, Agora recommends using an external audio device. If you experience excessive audio processing or high CPU usage, contact Agora customer support and submit a ticket to disable the echo cancellation of the SDK.
- If the audio experience in step 2 is better, Agora recommends not using an external audio device.
If a user plays media resources such as the background music, audio effects, and animations, the sounds of these media resources might be captured by the microphone, which produces echoes. Agora recommends calling the following APIs to play media resources on the local client or publish media resources to all remote clients, so that you can cancel the echoes through the Agora SDK.
|SDK||Platform||API (take Java as an example)||Usage|
|Agora Video SDK||
|Agora MediaPlayer Kit||