Macbook air freezes when playing games and audio in game "loops".
So when I play games like league of legends or minecraft, periodically (every month or so) my macbook air completely freezes and the audio that the game (or discord call) was making loops if it was like beeping. It's like Da, Da, Da, Da. I believe it's not the CPU nor the RAM because I have every other applications closed (Expect for discord), when I'm playing. The only way to resolve this is to hold down the power button and it restarts my mac. I tried doing SMC and PRAM resets but it's still no use. Also I keep my game graphic qualities to the lowest and change every setting in the "video" tab the lowest.
Two of my other friends also use their macbook air/pro to play but they never encountered this issue + they have other applications open as well.
If anyone knows what's going on, please tell me because it's been happening for the past 8-10 months.
MacBook Air 13″, macOS 10.15