How to read the audio output stream

I want to make a cava clone (GitHub - karlstav/cava: Console-based Audio Visualizer for Alsa). My question is how can i read the audio output stream from the system in cpal or some other similar crate?

1 Like

The simplest way to do it would be to have your application create a JACK input port (or stereo pair) and leave it to the user to decide what they want to connect it to. PulseAudio has a way to monitor output ports, which cava uses by default. As noted in the cava documentation, it gets trickier with ALSA because you need to create a loopback device.

1 Like

is there a way to do it with wasapi (or asio)?