In the past, Soundflower has been a great way to record audio generated by applications on my Mac. Soundflower's GitHub page indicates that it does not (yet?) support M1 Macs. In the absence of this great utility, how have M1 Mac users gone about recording computer audio?
BlackHole is similar to Soundflower. Rogue Amoeba is better, but not free.
There's a discussion regarding Apple Silicon compatibility at https://github.com/ExistentialAudio/BlackHole/discussions/227
I've never tried it myself (prefer RA) but it might be worth a shot.