Grabbing audio from another app

I was wondering how to grap audio which is being output by an app and send it over to UE5 so that I can use it in my Niagara visualiser. C++ answers accepted.

Any help would be appreciated. Thank you!

P.S. I already have a system that makes an audio spectrum, measures the amplitude and sets it to the velocity of the particles in Niagara to make the visualiser.