Contributors: Thomas Kou, Hansson Lin
An audio visualization program and our SE 101 term project. For use with Raspberry Pi and
programmed in Python 3.6 using PyCharm. Able to display both .wav
audio files and audio
from microphone input.
The src
folder contains code that runs on a computer, decoding audio signals and
sending them to an external MQTT server. The raspberry
folder contains a script
Lights.py
that runs on the Raspberry Pi, which is responsible for receiving messages
from the MQTT server and displaying them on an attached 32x64 LED board.
Raspberry Pi initialization:
- With an internet connection and with superuser privileges, run
raspberry/Lights.py
through the terminal with the arguments--led-rows=32 --led-cols=64 --led-pwm-bits 1 --led-slowdown-gpio 2 --led-no-hardware-pulse LED-NO-HARDWARE-PULSE
.
WAV playback from a computer:
- Place a
.wav
file in theaudio
folder. Insrc/Main.py
, setINPUT
to false and set theFILE
variable to the target file path relative to theaudio
folder. Then, runsrc/Main.py
.
Microphone input from a computer:
- In
src/Main.py
, setINPUT
to true. SetTIMED
to either true or false depending on whether timed or indefinite microphone input is desired. If timed, also setSECONDS
to the desired duration. Then, runsrc/Main.py
.
-
Computer:
numpy
,pyaudio
,wave
, andpaho-mqtt
. -
Raspberry Pi:
paho-mqtt
andrgbmatrix
. -
matplotlib
andtkinter
are optional and used only for testing purposes. If needed, these can be commented out.
The file raspberry/SampleBase.py
is sourced from the rpi-rgb-led-matrix
repository and
used under the GPL v3.0 license. Credits go to hzeller and the other contributors of the
repository.