Sounds like you have the built-in microphone selected as an input in Settings > Audio.
Capturing desktop audio (from your game) on MacOS requires 3rd party software: either SoundFlower, iShowU, LoopBack, or something similar. Which are you using?
If you are not using any, then the problem is that you're playing game audio through your speakers and capturing it along with background noise through a microphone. In that case it is not possible to isolate one from the other.
Disable the microphone and follow the guide for recording desktop audio on MacOS.
How to capture desktop audio on Mac