enableHeadphoneAEC method

Future<void> enableHeadphoneAEC(
  1. bool enable
)

Whether to turn on acoustic echo cancellation (AEC) when using the headphone.

Available since: 1.1.0 Description: When enableAEC is used to turn on echo cancellation, it is only turned on when the speaker is used for mobile terminal equipment. Call this function if you need to turn echo cancellation on or off when using the headset. Use case: It is common when the mobile device is connected to a external sound card as the audio output source. In order to eliminate the echo in this case, you need to call this function to turn on the echo cancellation. Default value: Android is off by default and iOS is on by default. When to call: It needs to be called after createEngine, before startPublishingStream, startPlayingStream, startPreview, createMediaPlayer, createAudioEffectPlayer and createRealTimeSequentialDataManager. Caution: Turning on echo cancellation will increase the ear return delay. On the iOS platform, the SDK cannot distinguish between the headset and the external sound card. If you use this function to turn off the system echo cancellation when using the headset, the sound played by the external sound card will be collected when the user accesses the external sound card. Restrictions: None. Related APIs: When the headset is not used, you can set whether the SDK turns on echo cancellation through enableAEC. Platform differences: Only supports iOS and Android.

  • enable Whether to enable, true: enable, false: disable

Implementation

Future<void> enableHeadphoneAEC(bool enable) async {
  return await ZegoExpressImpl.instance.enableHeadphoneAEC(enable);
}