More particularly: How can I use python with ALSA to capture audio input?
I'm thinking about doing an oled-based spectrum analyzer for Pi-based audioplayer. One part of the solution is to read the audio currently playing. I've tried this using ALSA in Python:
inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NONBLOCK)
At this point the script dies:
alsaaudio.ALSAAudioError: No such file or directory
Adding a card like this doesn't work either:
card = 'sysdefault:CARD=ALSA'
inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NONBLOCK, card)
I've seen various related posts on raspbian, but no solution.