How to record system output audio?

Hi! I am trying to make an app that can record the system output audio (what you hear) in real time and transcribe it with an api. However, the existing plugins seem to only record mic audio. Is there a plug-in for this? Thanks!