enableAEC method
Enables or disables Acoustic Echo Cancellation (AEC).
Android only - On iOS, this returns 0 without invoking native code as iOS handles AEC at the system level via AVAudioSession.
Returns 0 on success, -1 or error code on failure.
Implementation
@override
Future<int> enableAEC({required bool enable}) async {
// Only call native method on Android - iOS doesn't expose this in the SDK
if (!Platform.isAndroid) {
_logCall('enableAEC (skipped on iOS)', {'enable': enable});
return 0;
}
final args = {'enable': enable};
_logCall('enableAEC', args);
try {
final result = await methodChannel.invokeMethod<int>('enableAEC', args);
_logResponse('enableAEC', result);
return result ?? -1;
} on PlatformException catch (e) {
_logError('enableAEC', e);
return -1;
}
}