Code for a Raspberry Pi audio-visualiser.
Required packages:
python-alsaaudio
mpg123
unicornhat
To install the Unicorn HAT:
curl -sS get.pimoroni.com/unicornhat | bash
To force HDMI audio:
-
sudo nano /boot/config.txt
-
Add the following:
hdmi_force_hotplug=1
hdmi_force_edid_audio=1
To convert a mp3 file to a wav file:
mpg123 -w 'output.wav' 'input.mp3'
To run the script:
sudo python visualiser.py output.wav