Stop recording speaker sound when recording on mic in swift

I am trying to use AVAudioEngine for recording and playing for a voice chat kind of app, but when the speaker plays any audio while recording, the recording take the speaker audio as input. I want to filter that out. Are there any suggestions for the swift code

Hello @satya-chandrahas, thank you for your post. You can accomplish that by enabling voice processing on your engine's input node. Please refer to the Using voice processing sample code project for an example implementation.

Stop recording speaker sound when recording on mic in swift
 
 
Q