Configure in-ear monitoring

更新时间:
复制 MD 格式

RTC SDK provides methods to allow you to configure in-ear monitoring. This topic describes how to configure in-ear monitoring.

Background information

With the rise of online entertainment services such as co-streaming and online Karaoke with multiple participants over the recent years, Real-Time Communication (RTC) is suitable for scenarios such as audio and video conferencing and online education, and provides various technical solutions for entertainment scenarios such as in-ear monitoring. When streamers sing, the streamers need to hear their voices for better performance. In this case, streamers can use in-ear monitors to obtain feedback at low latency. Alibaba Cloud RTC SDK supports the in-ear monitoring feature and allows you to change the volume of in-ear monitors.

Implementation methods

RTC SDK allows you to call enableEarBack to enable or disable the in-ear monitoring feature and call setEarBackVolume to change the volume of in-ear monitors.

  • Android
    mAliRtcEngine = AliRtcEngine.getInstance(getApplicationContext());
    // Enable the in-ear monitoring feature. Default value: false.
    mAliRtcEngine.enableEarBack(true);
    
    // Change the volume of in-ear monitors. Valid values: 0 to 100. Default value: 100. The value of 100 indicates that the original volume of the microphone is used.
    int volume = 80;
    mAliRtcEngine.setEarBackVolume(volume);

    For more information, see enableEarBack and setEarBackVolume.

  • iOS
    // Enable in-ear monitoring.
    [self.engine enableEarBack:YES];
    // Change the volume of in-ear monitors. Valid values: 0 to 100. Default value: 100.
    [self.engine setEarBackVolume:80];

    For more information, see enableEarBack and setEarBackVolume.

Note You must enable the in-ear monitoring feature before you change the volume of in-ear monitors.