An Audio Visualizer displayed using an LED Strip.
Demo: Audio Visualizer Demo - Raspberry Pi 4, WS2812b LED programmable strip
- Raspberry Pi 4: Link to buy
- WS2812b LED Programmable Strip: Link to buy
- Connector / Adapter : Link to buy
- Diode with forward voltage drop = 0.7 Volt
- 3 x 1 Male Connector Clips
- 5 Volt, 2.5 Amp Power Supply
Since Pi GPIO Pins only output 3.5 V, we need to reduce the reference voltage in the strip or implement a level-shifter chip. In my project, I did soldered a 0.7 V Diode in series with the connector to the LED and Power Supply. When directed in the flow of the in order to make the reference voltage ~= 4.3 V.
Here, is a good link to a tutorial to setup the hardware configuration and initialize the developer tools in the Pi
Dependencies:
- rpi_ws281x (LED Control)
- Librosa (Audio Analysis)
- Python 3.7.3 (Guaranteed, untested for other versions)
- Pip 21.1.1 (Guaranteed, untested for other versions)
# Install rpi_ws281x
git clone https://github.com/jgarff/rpi_ws281x
cd rpi_ws281x/python
# Setup a Virtual Environment
mkdir env
sudo -s
python3 -m venv env/
source env/bin/activate
# Install Librosa, Guide : [https://www.youtube.com/watch?v=ye96YO-lz_4]
sudo apt-get install llvm
LLVM_CONFIG=/usr/bin/llvm-config pip3 install llvmlite==0.32
pip3 install numpy==1.16.1 numba==0.49
pip3 install librosa
From here, move the audioVisualizer.py file to rpi_ws281x/python/examples
and the desired audio file to rpi_ws281x/python
# Go to proper directory
cd rpi_ws281x/python
# Enter Root Mode
sudo -s
# Activate Virtual Environment
source env/bin/activate
# Run script
python examples/audioVisualizer.py
If you have any bugs or feature requests, please submit an issue.
If you wish to contribute, fork my project and create a pull request
Audio_Visualizer_Pi is released under the MIT LICENSE. See LICENSE for details