Alsa audio to GPIO LED equaliser
-
I got a 3d Xmas tree pcb with a bunch of programmable LEDs from the pihut that are controlled over GPIO.
I thought it would be cool to have a python script that reads the audio stream of my gameplay and lights up the tree in time with the music.
I've read a little bit into it and I'm thinking I'll have to use an alsa loopback driver and ideally want to use hardware accelerated fft that makes use of the gpu to improve fast Fourier transformation speed.
I've seen lots of examples that use windowed environments, bloated packages, etc. In trying to do it direct/low level as possible where I can just run it from the terminal.
Audio >>> python>>>FFT>>GPIO
I'm still in the brainstorming phase but if anyone has ideas/suggestions I'm open to them
-
I think if you do not need great temporal and spectral resolution, then the performance of the fft is not going to be your bottleneck.
I mean, we are talking about maybe an update every 200ms, and how many leds, 25?But it is a cool idea! Please keep us updated!
-
I think the first step would be to test if I can capture audio natively before I pass it through to GPIO.
I've narrowed it down to wanting to use the alsa sound driver. I want to be able to hear the sound from my speakers while it's being captured which is looking like I'll need to use a loopback device. Eg snd-aloop
I'll update this post when I have more details but I've gotten so far as sorting dependencies and just need the proper configs for
/etc/.asound.conf
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.