100ms Logo

100ms

Docs

Search docs
/

Echo Cancellation

The 100ms SDK automatically applies the best-known settings to cancel echoes from devices. It prefers to use the device's hardware for echo cancellation over software. Therefore, if a device has hardware for echo cancellation, the SDK will use it.

We have found that some Android devices have issues with their hardware echo cancellation, even though they have the hardware, it may be faulty. In such cases, we must rely on software-based echo cancellation on such devices. Although we continuously update the SDK with the latest known devices that have this issue, you may encounter one that we haven't tested yet.

If you find that an Android device has the aforementioned hardware echo cancellation issue, you may try using software-based echo cancellation instead of relying on the device's hardware to solve the problem.

The SDK provides you with an option to disable 'hardware echo cancellation' and use software-based echo cancellation on the device. You can create an instance of the HMSAudioTrackSettings class with the useHardwareEchoCancellation property set to false. When the useHardwareEchoCancellation property is set to false, the SDK will not use hardware echo cancellation. Then, you can use this HMSAudioTrackSettings instance when building an instance of the HMSDK class using the static build method.

// Creating Audio Setting with 'hardware echo cancellation' set to false const audioSettings = new HMSAudioTrackSettings({
useHardwareEchoCancellation: false
}); // Creating Track settings with Audio Settings for HMSSDK const trackSettings = HMSTrackSettings({ audio: audioSettings }); // Pass the Track Settings object to the build function // Now, the SDK will not use hardware echo cancellation c̶o̶n̶s̶t̶ ̶h̶m̶s̶I̶n̶s̶t̶a̶n̶c̶e̶ ̶=̶ ̶a̶w̶a̶i̶t̶ ̶H̶M̶S̶S̶D̶K̶.̶b̶u̶i̶l̶d̶(̶)̶;̶ const hmsInstance = await HMSSDK.build({ trackSettings });

💡 Note: It is important to note that hardware echo cancellation must be turned off based on specific device models. Disabling it for all devices can result in echoing on devices that did not experience it before. It is important to use this feature selectively only on devices that require it.


Have a suggestion? Recommend changes ->

Was this helpful?

1234