I want to get in real-time the audio samples that are sent to the output device (i.e. analog audio or HDMI). Is there any way to read those samples? I'm running the latest Raspian Lite on an RPi4.
The goal is to do something (i.e. elaborate them) with those samples in real-time. I don't want to send the elaborated samples to the output device again. I'm just asking how to "intercept" them before they reach the output device.
Hope this is more clear.
cat
could ever give you audio samples. However, you may be able to record audio on the output device (using the method I linked in the comment above) and then read the data with your favorite software/library/python package/etc. – Patrick Cook Aug 22 '19 at 3:06