The RTC SDK provides an interface for you to set up ear return. By reading this article, you can learn how to set the ear return.

Background information

With the rise of Internet entertainment scenes such as Lianmai and multiplayer online karaoke in recent years, Real-Time Communication can not only support audio and video conferences, online education and other scenes, but also derive various technical solutions to entertainment scenes. Ear return is one of them. In the entertainment singing scene, the anchor needs to hear his own sound effect while singing in order to better show himself. In the case of low latency, the ear return can give the anchor a more real feedback. The Alibaba Cloud RTC SDK supports the ear return function and also supports adjusting the volume of the ear return.

Implementation method

The RTC SDK provides enableEarBack methods to enable or disable the ear return function and setEarBackVolume methods to set the ear return volume.

  • Android
    mAliRtcEngine = AliRtcEngine.getInstance(getApplicationContext());
    // Set the return feature to enable. Default value: false.
    mAliRtcEngine.enableEarBack(true);
    
    // Set the volume of the volume. Valid values: 0 to 100. Default value: 100. This indicates the original volume recorded by the microphone.
    int volume = 80;
    mAliRtcEngine.setEarBackVolume(volume);

    For more information about interfaces, see enableEarBack and setEarBackVolume.

  • iOS
    // Open ear return
    [self.engine enableEarBack:YES];
    // Set the return volume of the ear. Valid values: 0 to 100. Default value: 100
    [self.engine setEarBackVolume:80];

    For more information about interfaces, see enableEarBack and setEarBackVolume.

Note The ear return volume can only be set when the ear return function is turned on.