Recording System Sound

I’ve been trying for a couple of days to find a way to export the system sound so that I can record it in a script I’ve been writing. The script is use arecord as the recording software. Is there a way to do this?
Thanks in advance,

They should be located under /usr/share/sounds/

These seems to be the wav files of recorded sounds. What I’m looking for is to record what is being played over my speakers.

Been a while since I’ve done something like that. I believe you’re supposed to select a “Monitor of…” as your input source, rather than a microphone.

I’ve seen in the arecord -L and -D options on the man page but have no idea how to use them. Is that what you’re referring to?