The built-in Screenshot.app on macOS can record the screen with audio.
See https://support.apple.com/guide/mac-help/take-a-screenshot-o...
See https://support.apple.com/guide/mac-help/take-a-screenshot-o...
Without some sort of fancy hardware or hacky software, I am not sure if it's possible -- at least not as of 6 or so months ago when I was looking for it.
To test:
Use the link above and try to record the audio of something like a YouTube video while recording the screen playing the video. If you can manage to get this to work, please share your results. I would be so obliged. This is not my goal of the software, but it's a quick test to show you what I am looking for.