Lights
Posts: 2
Joined: Mon Feb 06, 2017 4:44 pm

Making an Audio Visualiser

Mon Feb 06, 2017 5:10 pm

Hello,

I have been attempting to start a project that I have previously completed on an Arduino with an external circuit, but I want to expand it to a Raspberry P, using only the internal processing.

The concept is that I want to take audio into the Pi via bluetooth, sample it, process it using a FFT or a similar method, build a frequency vs amplitude matrix, and then output the matrix to LEDs while simultaneously outputting the audio through the 3.5mm jack.

I currently own a Raspberry Pi 3 B and all of the hardware to complete the project, but my problem exists in the programming field. I have very little programming experience on the Pis, and am learning as I go. The big issue I am running into at the moment is figuring out how to do the sampling in between the input and output (as there are many projects done where the user simply streams the audio from the bluetooth to the 3.5mm jack).

In order to pass the audio from the bluetooth port to the jack, I was going to use this project: http://raspberrypi.stackexchange.com/qu ... th-speaker. In this script, I assume that there would be an appropriate location to call a function that would do the transform and be able to output the amplitude vs frequency matrix that I can write on my own, but I have no idea how to use linux in that regard (almost all of my programming experience lies in MATLAB and C++).

Any points in the right direction to look through tutorials or previously completed solutions would be amazing. I don't necessarily want to become a programmer in linux, my end goals are set on getting this project done.

Thanks in advanced,
Lights

P.S. If this is a little bit too advanced for the beginners forum, I apologize. I am looking for any info ranging from tutorials to specific solutions. Let me know if I should edit this post or switch forums.

User avatar
topguy
Posts: 5612
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Making an Audio Visualiser

Tue Feb 07, 2017 11:28 am

The interesting detail from the guide you linked is that the solution is using Pulseaudio. I dont know much about PA but I know that its a pretty configurable and modularized audioframework.
So logically someone have made a visualizer for it before, and it probably doesn't matter much where the sound comes from, its the output you want to monitor and visualize.
So that led me here: https://github.com/karlstav/cava

You'll learn a bit about programming on the Pi just by trying to compile Cava and get it runnning.

Lights
Posts: 2
Joined: Mon Feb 06, 2017 4:44 pm

Re: Making an Audio Visualiser

Tue Feb 07, 2017 5:38 pm

topguy wrote:The interesting detail from the guide you linked is that the solution is using Pulseaudio. I dont know much about PA but I know that its a pretty configurable and modularized audioframework.
So logically someone have made a visualizer for it before, and it probably doesn't matter much where the sound comes from, its the output you want to monitor and visualize.
So that led me here: https://github.com/karlstav/cava

You'll learn a bit about programming on the Pi just by trying to compile Cava and get it runnning.
Oh wow thanks! I've been looking in all the wrong places, it seems. I have been searching for actual visualizers using LEDs but that was my mistake. On the same note, however, would you happen to know whereabouts I would be able to place the visualizer code into the project I had posted? I think it would be somewhere in the first large If loop, but I don't quite understand the syntax of this language as well as others.

Either way, thank you for your help, this will get me pretty far, I think.

Small edit: After reading through the github project again it seems like I won't need to use the original project as much as I thought I would, so discount that question. Thanks again!

recklessfb
Posts: 37
Joined: Wed Jul 06, 2016 12:26 am

Re: Making an Audio Visualiser

Wed Feb 15, 2017 3:26 pm

Hey, I'd like to do something similar with my sensehat led matrix. I have a Pi3 which runs amazon alexa which plays back to a bluetooth speaker. My initial idea was to display different sprites depending on what alexa was doing but that would have involved changing the java code which I have no experience with. So now i'm looking into an audio viualizer which would visualize audio inputs and outputs.
Where you able to get your project running?

transilluminate
Posts: 3
Joined: Thu Mar 05, 2015 3:12 pm

Re: Making an Audio Visualiser

Sun Jul 01, 2018 1:37 pm

Hi!

You may be interested in this that I've just put up on GitHub: https://gist.github.com/transilluminate ... a9cf70139c

The tricky part was actually configuring the loopback device! 8-)

Return to “Beginners”